-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(es/minifier): Change default pass limit to 2 (#4924)
- Loading branch information
Showing
9 changed files
with
89 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
expose(function() { | ||
return export_default; | ||
}); | ||
var export_default = require("70jDX").default; | ||
var Value, export_default = require("70jDX").default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ | |
888, | ||
179 | ||
], function() { | ||
var b; | ||
return a(a.s = 7139); | ||
}), _N_E = a.O(); | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/vercel/full-compact/react-autosuggest/1/output/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,72 @@ | ||
var a = 86400000, b = 7 * a, c = 365.25 * a; | ||
export default function(f, h) { | ||
var b = 3600000, a = 24 * b, c = 7 * a, d = 365.25 * a; | ||
export default function(g, i) { | ||
try { | ||
if ("string" == typeof f && f.length > 0) return function(e) { | ||
if ((e = String(e)).length > 100) throw new Error("Value exceeds the maximum length of 100 characters."); | ||
var f = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e); | ||
if (!f) return NaN; | ||
var d = parseFloat(f[1]), g = (f[2] || "ms").toLowerCase(); | ||
switch(g){ | ||
if ("string" == typeof g && g.length > 0) return function i(f) { | ||
if ((f = String(f)).length > 100) throw new Error("Value exceeds the maximum length of 100 characters."); | ||
var g = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(f); | ||
if (!g) return NaN; | ||
var e = parseFloat(g[1]), h = (g[2] || "ms").toLowerCase(); | ||
switch(h){ | ||
case "years": | ||
case "year": | ||
case "yrs": | ||
case "yr": | ||
case "y": | ||
return d * c; | ||
return e * d; | ||
case "weeks": | ||
case "week": | ||
case "w": | ||
return d * b; | ||
return e * c; | ||
case "days": | ||
case "day": | ||
case "d": | ||
return d * a; | ||
return e * a; | ||
case "hours": | ||
case "hour": | ||
case "hrs": | ||
case "hr": | ||
case "h": | ||
return 3600000 * d; | ||
return e * b; | ||
case "minutes": | ||
case "minute": | ||
case "mins": | ||
case "min": | ||
case "m": | ||
return 60000 * d; | ||
return 60000 * e; | ||
case "seconds": | ||
case "second": | ||
case "secs": | ||
case "sec": | ||
case "s": | ||
return 1000 * d; | ||
return 1000 * e; | ||
case "milliseconds": | ||
case "millisecond": | ||
case "msecs": | ||
case "msec": | ||
case "ms": | ||
return d; | ||
return e; | ||
default: | ||
throw new Error("The unit ".concat(g, " was matched, but no matching case exists.")); | ||
throw new Error("The unit ".concat(h, " was matched, but no matching case exists.")); | ||
} | ||
}(f); | ||
if ("number" == typeof f && isFinite(f)) return (null == h ? void 0 : h.long) ? e(f) : d(f); | ||
}(g); | ||
if ("number" == typeof g && isFinite(g)) return (null == i ? void 0 : i.long) ? f(g) : e(g); | ||
throw new Error("Value is not a string or number."); | ||
} catch (i) { | ||
var j = g(i) ? "".concat(i.message, ". value=").concat(JSON.stringify(f)) : "An unknown error has occurred."; | ||
throw new Error(j); | ||
} catch (j) { | ||
var k = h(j) ? "".concat(j.message, ". value=").concat(JSON.stringify(g)) : "An unknown error has occurred."; | ||
throw new Error(k); | ||
} | ||
}; | ||
function d(b) { | ||
var c = Math.abs(b); | ||
return c >= a ? "".concat(Math.round(b / a), "d") : c >= 3600000 ? "".concat(Math.round(b / 3600000), "h") : c >= 60000 ? "".concat(Math.round(b / 60000), "m") : c >= 1000 ? "".concat(Math.round(b / 1000), "s") : "".concat(b, "ms"); | ||
} | ||
function e(c) { | ||
var b = Math.abs(c); | ||
return b >= a ? f(c, b, a, "day") : b >= 3600000 ? f(c, b, 3600000, "hour") : b >= 60000 ? f(c, b, 60000, "minute") : b >= 1000 ? f(c, b, 1000, "second") : "".concat(c, " ms"); | ||
var d = Math.abs(c); | ||
return d >= a ? "".concat(Math.round(c / a), "d") : d >= b ? "".concat(Math.round(c / b), "h") : d >= 60000 ? "".concat(Math.round(c / 60000), "m") : d >= 1000 ? "".concat(Math.round(c / 1000), "s") : "".concat(c, "ms"); | ||
} | ||
function f(d) { | ||
var c = Math.abs(d); | ||
return c >= a ? g(d, c, a, "day") : c >= b ? g(d, c, b, "hour") : c >= 60000 ? g(d, c, 60000, "minute") : c >= 1000 ? g(d, c, 1000, "second") : "".concat(d, " ms"); | ||
} | ||
function f(b, c, a, d) { | ||
function g(b, c, a, d) { | ||
return "".concat(Math.round(b / a), " ").concat(d).concat(c >= 1.5 * a ? "s" : ""); | ||
} | ||
function g(a) { | ||
function h(a) { | ||
return "object" == typeof a && null !== a && "message" in a; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
fc0d8e3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
es/full/minify/libraries/antd
1180828171
ns/iter (± 7380144
)2555952428
ns/iter (± 11259122
)0.46
es/full/minify/libraries/d3
337843262
ns/iter (± 8921366
)629749257
ns/iter (± 12426696
)0.54
es/full/minify/libraries/echarts
1555499681
ns/iter (± 4350716
)2898365097
ns/iter (± 9299783
)0.54
es/full/minify/libraries/jquery
71443790
ns/iter (± 735410
)116629672
ns/iter (± 8654481
)0.61
es/full/minify/libraries/lodash
97959619
ns/iter (± 180052
)171076887
ns/iter (± 5028230
)0.57
es/full/minify/libraries/moment
41616680
ns/iter (± 98612
)65185182
ns/iter (± 829827
)0.64
es/full/minify/libraries/react
13657738
ns/iter (± 29050
)20627522
ns/iter (± 133650
)0.66
es/full/minify/libraries/terser
340588325
ns/iter (± 4818797
)605599482
ns/iter (± 10631162
)0.56
es/full/minify/libraries/three
381695459
ns/iter (± 3788339
)864793215
ns/iter (± 6209125
)0.44
es/full/minify/libraries/typescript
2922161640
ns/iter (± 21801238
)5820515322
ns/iter (± 34636969
)0.50
es/full/minify/libraries/victory
502115787
ns/iter (± 8034452
)1191687819
ns/iter (± 11883582
)0.42
es/full/minify/libraries/vue
108955424
ns/iter (± 905847
)188804105
ns/iter (± 8993503
)0.58
es/full/codegen/es3
25000
ns/iter (± 125
)34637
ns/iter (± 141
)0.72
es/full/codegen/es5
25005
ns/iter (± 290
)34593
ns/iter (± 160
)0.72
es/full/codegen/es2015
25011
ns/iter (± 144
)34591
ns/iter (± 126
)0.72
es/full/codegen/es2016
25027
ns/iter (± 120
)34603
ns/iter (± 193
)0.72
es/full/codegen/es2017
25025
ns/iter (± 2996
)34612
ns/iter (± 170
)0.72
es/full/codegen/es2018
25017
ns/iter (± 112
)34589
ns/iter (± 127
)0.72
es/full/codegen/es2019
25025
ns/iter (± 204
)34565
ns/iter (± 185
)0.72
es/full/codegen/es2020
25008
ns/iter (± 114
)34596
ns/iter (± 149
)0.72
es/full/all/es3
139616270
ns/iter (± 556042
)196065726
ns/iter (± 823056
)0.71
es/full/all/es5
131697075
ns/iter (± 496395
)186101109
ns/iter (± 1050325
)0.71
es/full/all/es2015
101679776
ns/iter (± 309780
)148328503
ns/iter (± 823789
)0.69
es/full/all/es2016
101021972
ns/iter (± 432020
)147216129
ns/iter (± 966197
)0.69
es/full/all/es2017
100413589
ns/iter (± 2970199
)146360313
ns/iter (± 893545
)0.69
es/full/all/es2018
98817693
ns/iter (± 569085
)144243937
ns/iter (± 714171
)0.69
es/full/all/es2019
98124776
ns/iter (± 541073
)144000126
ns/iter (± 849381
)0.68
es/full/all/es2020
93996532
ns/iter (± 717604
)139352743
ns/iter (± 743856
)0.67
es/full/parser
411160
ns/iter (± 32560
)597784
ns/iter (± 95659
)0.69
es/full/base/fixer
18342
ns/iter (± 254
)26925
ns/iter (± 256
)0.68
es/full/base/resolver_and_hygiene
100352
ns/iter (± 1482
)143394
ns/iter (± 1940
)0.70
serialization of ast node
131
ns/iter (± 0
)178
ns/iter (± 0
)0.74
serialization of serde
132
ns/iter (± 0
)180
ns/iter (± 0
)0.73
This comment was automatically generated by workflow using github-action-benchmark.