We're updating the issue view to help you get more done. 

vec function is substantially slower than into function

Description

(vec coll) and (into [] coll) do exactly the same thing. However, due to into using transients, it is substantially faster. On my machine:

(time (dotimes [_ 100] (vec (range 100000))))
"Elapsed time: 732.56 msecs"

(time (dotimes [_ 100] (into [] (range 100000))))
"Elapsed time: 491.411 msecs"

This is consistently repeatable.

Since vec's sole purpose is to transform collections into vectors, it should do so at the maximum speed available.

Environment

None

Status

Assignee

Unassigned

Reporter

Luke VanderHart

Labels

Approval

Incomplete

Patch

None

Fix versions

Affects versions

Release 1.5

Priority

Major