Duplicate
Details
Assignee
UnassignedUnassignedReporter
Anton HaraldAnton HaraldLabels
Approval
TriagedPatch
CodePriority
MinorAffects versions
Details
Details
Assignee
Unassigned
UnassignedReporter
Anton Harald
Anton HaraldLabels
Approval
Triaged
Patch
Code
Priority
Affects versions
Created April 8, 2016 at 10:11 PM
Updated May 15, 2017 at 10:09 PM
Resolved May 15, 2017 at 10:09 PM
When looking at the code of the build-in functions '<' and '>', (next more) is invoked twice in each comparison of two neighboring arguments.
Proposed: Compute (next more) only once per 'iteration' for the following set of functions that have the same code pattern: =, ==, <, <=, >, >=.
Perf improvements (see comments for more details):
Function
Arity
Before
After
% improved
<
4
140.7 ns
141.6 ns
-0.6%
<
10
505.3 ns
460.3 ns
8.9%
<
100
9.0 µs
8.6 µs
4.4%
<
10000
885 µs
851 µs
3.8%
=
4
86.1 ns
86.8 ns
0.8%
=
10
333.4 ns
300.6 ns
9.8%
=
100
4.28 µs
3.65 µs
14.7%
=
10000
397.4 µs
353.3 µs
11.0%
==
4
138.1 ns
135.7 ns
1.7%
==
10
487.9 ns
460.9 ns
5.5%
==
100
5.58 µs
5.27 µs
5.6%
==
10000
565.0 µs
537.7 µs
4.8%
Patch: clj-1912.patch