Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Affects versions: Release 1.7
    • Fix versions: Release 1.8
    • Labels:
    • Environment:

      OSX 10.8.5, Oracle JDK1.8.0_25-b17

    • Approval:
      Ok
    • Patch:
      Code

      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:

      (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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              toxi Karsten Schmidt
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: