Is this 200x slowdown from 1.2 to 1.3 being tracked?

12 views
Skip to first unread message

Andy Fingerhut

unread,
Jan 24, 2011, 12:07:48 AM1/24/11
to cloju...@googlegroups.com
I've done some performance testing on this program:

https://github.com/jafingerhut/clojure-benchmarks/blob/master/collatz/collatz.clj-2.clj

which is a slight modification of one mentioned recently on the
Clojure group.

When run on Clojure 1.3 alpha4 it takes about 200 times more CPU time,
and generates and collects about 500 times more garbage, than when run
on Clojure 1.2. I've been using AOT compilation, and input values
like 30,000, 100,000, and 1,000,000. The factors on time and garbage
generated are similar for those 3 values. 1.3 alpha3 is very similar
to alpha4, and 1.3 alpha1 seems worse in that it often fails by
running out of heap space for the same max heap sizes that alpha3 and
alpha4 succeed on.

Is this a known issue?

David Powell mentioned in this thread

http://groups.google.com/group/clojure/browse_thread/thread/3a876e19e067997b/05d92880f9189b10#05d92880f9189b10

that it is a known problem with the Clojure compiler, and "it seems to
only affect top-level defs". There are no top level def's in the code
linked above, except for a few function definitions. I don't know how
to determine whether this is the same problem David mentions.

Would it be worth filing a ticket to track this?

Thanks,
Andy

David Powell

unread,
Jan 24, 2011, 6:45:44 PM1/24/11
to cloju...@googlegroups.com

Hi,

I recently raised an issue, and posted a patch about the top level defs thing:

http://dev.clojure.org/jira/browse/CLJ-726

However, that isn't the problem here.

The slow down is caused by the new primitives work causing even? to make a reflective call.  I've updated an old issue and posted a patch for this:

http://dev.clojure.org/jira/browse/CLJ-380

--
Dave

Andy Fingerhut

unread,
Jan 25, 2011, 1:24:44 PM1/25/11
to cloju...@googlegroups.com
Thanks.  Any easy way to know we've hit them all?

Pardon my ignorance, but does this mean that setting *warn-on-reflection* to true causes the compiler only to print reflection warnings for a hand-coded list of functions, regardless of whether reflection actually occurs during the call?  I didn't see even? show up in any compiler warnings for that program with 1.3 alpha*

Thanks,
Andy

--
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To post to this group, send email to cloju...@googlegroups.com.
To unsubscribe from this group, send email to clojure-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/clojure-dev?hl=en.

David Powell

unread,
Jan 25, 2011, 1:37:39 PM1/25/11
to cloju...@googlegroups.com

The reflection was in clojure not in your code, so you'd only see it if you were compiling Clojure itself.  And I think Clojure legitimately uses reflection in some places.

I believe that there is some work under way to develop performance regression tests.

Also the 1.3 branch is still in development, so things probably just aren't finished yet.

--
Dave

Reply all
Reply to author
Forward
0 new messages