Use PAM for small maps when assigned to a var rather than always using PHMs

Description

I'm reproposing the fix I implemented for http://dev.clojure.org/jira/browse/CLJ-944 a while ago as an enhancement rather than as a defect.

Currently when a map is used as the value of a `def` expression, unless it's an empty map, it will always be a PersistentHashMap even if it's a small map.

The current patch makes makes small maps be compiled to PAMs, consistently with how it's handled in lexical contexts, only using PHMs when the number of elements is above the threshold

Environment

None

Attachments

1

Activity

Show:

Nicola MomettoMarch 9, 2015 at 7:40 PM

Alex MillerDecember 8, 2014 at 3:47 PM

We're just splitting the ticket apart, maps will be a separate ticket/patch.

Nicola MomettoDecember 8, 2014 at 3:19 PM

This is now out of scope for now that's focused only on vectors.

Alex MillerNovember 15, 2014 at 6:17 PM

This might be subsumed under the small collections CLJ-1517, not sure.

Declined

Details

Assignee

Reporter

Patch

Code

Priority

Created November 15, 2014 at 6:14 PM
Updated March 9, 2015 at 7:40 PM
Resolved March 9, 2015 at 7:40 PM