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

areduce speed improvements

Description

Two performance improvements for areduce:

1. Call alength once, rather than every iteration
2. Use unchecked-inc-int instead of inc since array indices are limited to int range

Example:

1 2 (def a (long-array (range 1000))) (areduce a i ret 0 (+ ret (aget a i)))

Criterium quick-bench:

  • 1.7.0-RC2: 15.5 ms

  • RC2+patch: 7.7 ms

Patch: clj-1765-2.patch
Screened by: Alex Miller

Environment

OSX 10.8.5, Oracle JDK1.8.0_25-b17

Status

Assignee

Unassigned

Reporter

Karsten Schmidt

Labels

Approval

Ok

Patch

Code

Fix versions

Affects versions

Release 1.7

Priority

Major