(object-array [1]) is ~3x slower than (object-array (rseq [1]))

Description

{{user=> (time (dotimes [_ 10000000] (object-array [1])))
"Elapsed time: 1178.116257 msecs"
nil
user=> (time (dotimes [_ 10000000] (object-array (rseq [1]))))
"Elapsed time: 422.42248 msecs"
nil}}

This appears to be because PersistentVector$ChunkedSeq does not implement Counted, so RT.count is iterating the ChunkedSeq to get its count.

Environment

None

Attachments

2

Activity

Stuart Halloway October 19, 2012 at 7:46 PM

Two patches to be applied together, the 10/19 patch adds tests and updates to latest test.generative.

Tassilo Horn October 11, 2012 at 4:17 PM

This patch makes PersistentVector$ChunkedSeq implement Counted.

Performance before:

Performance after (with the patch):

Also with Paul's test case.

Before:

After:

Paul Stadig October 9, 2012 at 8:11 PM

I don't believe this is Major priority, but I cannot edit the ticket after having created it.

Completed

Details

Assignee

Reporter

Labels

Approval

Patch

Priority

Affects versions

Fix versions

Created October 9, 2012 at 8:07 PM
Updated October 20, 2012 at 3:53 PM
Resolved October 20, 2012 at 3:53 PM