Use transient map in zipmap

Description

#'zipmap constructs a map without transients, where transients could improve performance.

Approach: Use a transient map internally, along with iterators for the keys and values. A persistent map is returned as before. The definition is also moved so that it resides below that of #'transient.

Performance:

(def xs (range 16384))
(def ys (range 16))

expression

1.7.0-beta3

+patch

(zipmap xs xs)

4.50 ms

2.12 ms

large map

(zipmap ys ys)

2.75 us

2.07 us

small map

Patch: CLJ-1005-zipmap-iterators.patch

Screened by: Alex Miller

Environment

None

Assignee

Unassigned

Reporter

Michał Marczyk

Labels

Approval

Vetted

Patch

Code

Affects versions

Priority

Major
Configure