Uploaded image for project: 'test.check'
  1. TCHECK-134

Improve test.check ClojureScript's random number generator speed

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Completed
    • Labels:
    • Patch:
      Code

      Description

      test.check's random number ClojureScript Implementation has a slow path in goog.math.Long's multiply method. The conditional checks (https://github.com/google/closure-library/blob/master/closure/goog/math/long.js#L683-L711) don't affect the correctness of the implementation. These conditionals instead add extra branching and allocation overhead.

      This patch ports the goog.math.Long's multiply over to ClojureScript with the conditionals removed. My benchmarking (benchmark code here https://gist.github.com/spinningtopsofdoom/7fb7fbe4ae7de159922a79e6f3f3e730) saw around a 2X speedup of Long generation

      I've ported of Google Closure Libraries test of the goog.math.Long multiply method to ClojureScript in this gist (https://gist.github.com/spinningtopsofdoom/e479bf6f3485cd85ba979b4e5562057a).

        Attachments

          Activity

            People

            • Assignee:
              gfredericks gfredericks
              Reporter:
              spinningtopsofdoom Peter Schuck
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: