8000 Opt: Use unsigned arithmetics in Range, instead of Longs. · scala-js/scala-js@09bbab0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 09bbab0

Browse files
committed
Opt: Use unsigned arithmetics in Range, instead of Longs.
Previously, `Range` used a number of intermediate operations on `Long`s to avoid overflow. The optimizer was already good enough to remove them in many cases, in particular when the step is `1` and/or the start is `0`, which are common cases. Now that the optimizer can reason about unsigned division, we can do a lot better. We can entirely avoid `Long` computations, *and* streamline a lot of code, by using unsigned `Int` arithmetics. This produces much better code for the cases where the optimizer cannot entirely get rid of the computations.
1 parent 52668c3 commit 09bbab0

File tree

3 files changed

+303
-192
lines changed

3 files changed

+303
-192
lines changed

project/Build.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2053,32 +2053,32 @@ object Build {
20532053
case `default212Version` =>
20542054
if (!useMinifySizes) {
20552055
Some(ExpectedSizes(
2056-
fastLink = 626000 to 627000,
2057-
fullLink = 96000 to 97000,
2056+
fastLink = 624000 to 625000,
2057+
fullLink = 94000 to 95000,
20582058
fastLinkGz = 75000 to 79000,
2059-
fullLinkGz = 25000 to 26000,
2059+
fullLinkGz = 24000 to 25000,
20602060
))
20612061
} else {
20622062
Some(ExpectedSizes(
2063-
fastLink = 425000 to 426000,
2064-
fullLink = 283000 to 284000,
2065-
fastLinkGz = 61000 to 62000,
2063+
fastLink = 424000 to 425000,
2064+
fullLink = 281000 to 282000,
2065+
fastLinkGz = 60000 to 61000,
20662066
fullLinkGz = 43000 to 44000,
20672067
))
20682068
}
20692069

20702070
case `default213Version` =>
20712071
if (!useMinifySizes) {
20722072
Some(ExpectedSizes(
2073-
fastLink = 443000 to 444000,
2074-
fullLink = 92000 to 93000,
2073+
fastLink = 442000 to 443000,
2074+
fullLink = 90000 to 91000,
20752075
fastLinkGz = 57000 to 58000,
2076-
fullLinkGz = 25000 to 26000,
2076+
fullLinkGz = 24000 to 25000,
20772077
))
20782078
} else {
20792079
Some(ExpectedSizes(
2080-
fastLink = 301000 to 302000,
2081-
fullLink = 258000 to 259000,
2080+
fastLink = 299000 to 300000,
2081+
fullLink = 257000 to 258000,
20822082
fastLinkGz = 47000 to 48000,
20832083
fullLinkGz = 42000 to 43000,
20842084
))

0 commit comments

Comments
 (0)
0