summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorHans Boehm <hboehm@google.com>2019-10-18 17:38:04 -0700
committerHans Boehm <hboehm@google.com>2019-10-22 14:47:23 -0700
commit014e30b3371ecf55ef5dd3b3bbe42ff49bf70ed3 (patch)
treeeadba7a738d607507115cbcf413882cd897d176f /annotations/generate_annotated_java_files.py
parent6840757abf14a399b8980068b2133393e2b22324 (diff)
Speed up BigInteger gcd with one small argument
gcd() goes out of its way to provide constant running time. This has unfortunate performance consequences for x.gcd(BigInteger.valueOf(2)). In such lopsided cases, compute the remainder of dividing one by the other first, and then use that in the binary gcd computation. It is unclear that such a point solution is the best way to address BigInteger performance issues. But fixing this obvious hole is probably useful in comparing strategies, even if this CL doesn't end up sticking. Added a BigInteger.gcd() test, since presubmit testing missed an earlier bug. Bug: 140780742 Test: Treehugger Change-Id: I9777b84b230497a22d632dff283866bcb5d1dc23
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions