You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use musl implementation of strftime rather than custom JS one. NFC
This leads to some code size savings in several tests, reduces the
differences between standalone mode and non-standalone mode and reduces
the amount of custom JS code we need to maitain.
In simple microbenchmark that does nothing but export `strftime` we do
code size win at `-O0` but a regression in codesize at `-O2`:
```
$ wc -c old_O0.*
74026 old.js
12124 old.wasm
86150 total
$ wc -c new_O0.*
62120 new.js
22852 new.wasm
84972 total
```
```
$ wc -c old_O2.*
8492 old.js
194 old.wasm
8686 total
$ wc -c new_O2.*
5040 new.js
14291 new.wasm
19331 total
```
This regression comes from the fact that `snprintf` is used in the
implementation of `strftime` and its hard to optimize away the cost of
that function.
In practice I suspect that any application large enough to call
`strftime` is likely already directly or indirectly pulling in
`snprintf` so I would hope that this will be codesize win in practice
since it removes about 3k of JS.
'%c': '%a%b%d%H:%M:%S%Y', // Replaced by the locale'sappropriatedateandtimerepresentation-e.g.,MonAug314:02:012013
733
-
'%D': '%m/%d/%y', // Equivalent to %m / %d / %y
734
-
'%F': '%Y-%m-%d', // Equivalent to %Y - %m - %d
735
-
'%h': '%b', // Equivalent to %b
736
-
'%r': '%I:%M:%S%p', // Replaced by the time in a.m. and p.m. notation
737
-
'%R': '%H:%M', // Replaced by the time in 24-hour notation
738
-
'%T': '%H:%M:%S', // Replaced by the time
739
-
'%x': '%m/%d/%y', // Replaced by the locale'sappropriatedaterepresentation
740
-
'%X': '%H:%M:%S', // Replaced by the locale'sappropriatetimerepresentation
741
-
// Modified Conversion Specifiers
742
-
'%Ec': '%c', // Replaced by the locale'salternativeappropriatedateandtimerepresentation.
743
-
'%EC': '%C', // Replaced by the name of the base year (period) in the locale'salternativerepresentation.
744
-
'%Ex': '%m/%d/%y', // Replaced by the locale'salternativedaterepresentation.
745
-
'%EX': '%H:%M:%S', // Replaced by the locale'salternativetimerepresentation.
746
-
'%Ey': '%y', // Replaced by the offset from %EC (year only) in the locale'salternativerepresentation.
747
-
'%EY': '%Y', // Replaced by the full alternative year representation.
748
-
'%Od': '%d', // Replaced by the day of the month, using the locale'salternativenumericsymbols,filledasneededwithleadingzerosifthereisanyalternativesymbolforzero;otherwise,withleading<space>characters.
749
-
'%Oe': '%e', // Replaced by the day of the month, using the locale'salternativenumericsymbols,filledasneededwithleading<space>characters.
750
-
'%OH': '%H', // Replaced by the hour (24-hour clock) using the locale'salternativenumericsymbols.
751
-
'%OI': '%I', // Replaced by the hour (12-hour clock) using the locale'salternativenumericsymbols.
752
-
'%Om': '%m', // Replaced by the month using the locale'salternativenumericsymbols.
753
-
'%OM': '%M', // Replaced by the minutes using the locale'salternativenumericsymbols.
754
-
'%OS': '%S', // Replaced by the seconds using the locale'salternativenumericsymbols.
755
-
'%Ou': '%u', // Replaced by the weekday as a number in the locale'salternativerepresentation(Monday=1).
756
-
'%OU': '%U', // Replaced by the week number of the year (Sunday as the first day of the week, rules corresponding to %U ) using the locale'salternativenumericsymbols.
757
-
'%OV': '%V', // Replaced by the week number of the year (Monday as the first day of the week, rules corresponding to %V ) using the locale'salternativenumericsymbols.
758
-
'%Ow': '%w', // Replaced by the number of the weekday (Sunday=0) using the locale'salternativenumericsymbols.
759
-
'%OW': '%W', // Replaced by the week number of the year (Monday as the first day of the week) using the locale'salternativenumericsymbols.
760
-
'%Oy': '%y', // Replaced by the year (offset from %C ) using the locale'salternativenumericsymbols.
0 commit comments