Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9923753ca3b36e1c6e13b56858d313c400b2b87a
https://github.com/WebKit/WebKit/commit/9923753ca3b36e1c6e13b56858d313c400b2b87a
Author: Sosuke Suzuki <[email protected]>
Date: 2026-06-02 (Tue, 02 Jun 2026)
Changed paths:
A JSTests/microbenchmarks/bigint-heap-dec.js
A JSTests/microbenchmarks/bigint-heap-inc.js
A JSTests/stress/bigint-inc-dec-in-place.js
M Source/JavaScriptCore/runtime/JSBigInt.cpp
M Source/JavaScriptCore/runtime/JSBigInt.h
Log Message:
-----------
[JSC] Use in-place JSBigInt for BigInt increment and decrement
https://bugs.webkit.org/show_bug.cgi?id=316155
Reviewed by Justin Michaud.
Following 313977@main, this patch makes BigInt increment / decrement
(n++ and n--) write the result directly into the allocated JSBigInt's
storage instead of computing into a Vector and copying it via
tryCreateFromImpl.
Adding or subtracting one wastes at most one digit after normalization,
so using the JSBigInt storage directly always makes sense in terms of
tradeoff, the same reasoning as the add case in 313977@main. When the
result would exceed maxLength, we fall back to the Vector path, and
when the result normalizes to zero, we return the cached zero BigInt.
ToT Patched
bigint-heap-inc 35.3500+-0.3672 ^ 26.3964+-0.9694 ^ definitely
1.3392x faster
bigint-heap-dec 34.7748+-1.0388 ^ 24.2538+-0.7962 ^ definitely
1.4338x faster
<geometric> 35.0597+-0.5210 ^ 25.3003+-0.6410 ^ definitely
1.3857x faster
* JSTests/microbenchmarks/bigint-heap-dec.js: Added.
* JSTests/microbenchmarks/bigint-heap-inc.js: Added.
* JSTests/stress/bigint-inc-dec-in-place.js: Added.
* Source/JavaScriptCore/runtime/JSBigInt.cpp:
(JSC::JSBigInt::absoluteAddOne):
(JSC::JSBigInt::absoluteSubOne):
(JSC::JSBigInt::incImpl):
(JSC::JSBigInt::decImpl):
* Source/JavaScriptCore/runtime/JSBigInt.h:
Canonical link: https://commits.webkit.org/314430@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications