[PATCH] MAP-INTO is O(n^2) for lists
Bug #1001043 reported by
James M. Lawrence
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
(let ((data (make-array 50000)))
(time (map-into data #'identity data))
nil)
=> Evaluation took:
0.000 seconds of real time
(let ((data (make-list 50000)))
(time (map-into data #'identity data))
nil)
=> Evaluation took:
7.533 seconds of real time
I have rewritten MAP-INTO to use (MAP NIL ...).
In addition to fixing lists, the new MAP-INTO shaves 30% off execution time for vectors in my benchmarks.
I checked the generic sequence code in MAP-INTO by removing the vector and list typecases and re-running tests.
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
This looks very nice!