Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects versions: Release 1.8
    • Fix versions: None
    • Approval:
      Triaged
    • Patch:
      Code

      Description

      A basic refactoring to remove the let form and only requires a single counter check for each iteration, yields an 25% performance increase. With the patch, 2 checks are only required for the last iteration (in case counter arg was <= 0)...

      ;; master
      (quick-bench (into [] (take 1000) (range 2000)))
      WARNING: Final GC required 34.82584189073624 % of runtime
      Evaluation count : 13050 in 6 samples of 2175 calls.
                   Execution time mean : 46.921254 µs
          Execution time std-deviation : 1.904733 µs
         Execution time lower quantile : 45.124921 µs ( 2.5%)
         Execution time upper quantile : 49.427201 µs (97.5%)
                         Overhead used : 2.367243 ns
      
      ;; w/ patch
      (quick-bench (into [] (take 1000) (range 2000)))
      WARNING: Final GC required 34.74448252054369 % of runtime
      Evaluation count : 18102 in 6 samples of 3017 calls.
                   Execution time mean : 34.301193 µs
          Execution time std-deviation : 1.714105 µs
         Execution time lower quantile : 32.341349 µs ( 2.5%)
         Execution time upper quantile : 37.046851 µs (97.5%)
                         Overhead used : 2.367243 ns
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: