New collection hash functions are too slow

Description

As reported ( https://groups.google.com/d/msg/clojure-dev/t6LAmVe-RLM/ekLTKxYfU5UJ ) by Mark Engelberg, the new collection hashing functions are slower than invoking the Murmur3 functions directly. See the attached zip for performance tests.

Approach: Made mix-collection-hash, hash-ordered-coll, and hash-unordered-coll use primitive type hints to avoid the bulk of the time.

Patch: clj-1365-v2.patch

Screened by:

Environment

None

Attachments

3

Activity

Show:

Alex Miller March 4, 2014 at 5:11 PM

Attached a test project with different variants for testing and better benchmarking. To run:

Results:

From these results, I infer that the unhinted version is slower (21 ms) than a static call (7 ms). Inlining gives you same perf as static. Hinting inputs and return gives almost the same perf (9 ms).

Alex Miller March 4, 2014 at 5:07 PM

Test project for different variants

Alex Miller March 4, 2014 at 3:06 PM

I will provide some more data for consideration of the options.

Rich Hickey March 4, 2014 at 2:44 PM

Could someone please test hinting hint count and the return? I'd hate for the answer to anyone's perf issues be inlining.

Alex Miller February 21, 2014 at 2:55 AM

It was reported by Mark Engelberg in his Instaparse rework - he observed these calls taking noticeably longer and overall times 10-20% down. I will ask him to chime in here.

Completed

Details

Assignee

Reporter

Approval

Ok

Patch

Code

Priority

Affects versions

Fix versions

Created February 20, 2014 at 5:26 PM
Updated March 11, 2014 at 4:42 PM
Resolved March 11, 2014 at 4:42 PM