Closed
Bug 1225401
Opened 9 years ago
Closed 8 years ago
Remove cities timezone data from ICU
Categories
(Core :: JavaScript: Internationalization API, defect)
Tracking
()
RESOLVED
FIXED
mozilla54
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: m_kato, Assigned: m_kato)
References
Details
Attachments
(3 files, 3 obsolete files)
1.17 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
2.73 MB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
4.19 MB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
My understand is that DateTimeFormat doesn't allow city data. But our ICU dat still has this data.
If removing this, it reduces 400KB and Chrome already removes it.
Assignee | ||
Comment 1•9 years ago
|
||
Assignee | ||
Comment 2•9 years ago
|
||
I should wait the review until landing ICU 56.1 update.
Assignee | ||
Comment 3•9 years ago
|
||
Assignee: nobody → m_kato
Attachment #8688759 -
Attachment is obsolete: true
Assignee | ||
Comment 4•9 years ago
|
||
Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8691695 [details] [diff] [review]
Part 1. Update update-icu.sh to remove cities from zone data
Our Intl API implementation doesn't allow that time zone is city name. So city names are unnecessary.
Also Chromium already removes cities from ICU data to reduce data size.
Attachment #8691695 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8691696 [details] [diff] [review]
Part 2. Remove cities from ICU data
This is diff by remove script. I can reduce ~400KB binary size.
Attachment #8691696 -
Flags: review?(jwalden+bmo)
Comment 7•9 years ago
|
||
Comment on attachment 8691695 [details] [diff] [review]
Part 1. Update update-icu.sh to remove cities from zone data
Review of attachment 8691695 [details] [diff] [review]:
-----------------------------------------------------------------
::: intl/update-icu.sh
@@ +48,5 @@
> +# Remove cities in timezone data.
> +for i in ${icu_dir}/source/data/zone/*.txt
> +do
> + grep -E '^ "meta:' $i > /dev/null
> + if [ $? -eq 0 ]; then
IRC kibitzes that this would be better written as:
if grep -q -E '^ "meta:' $i; then
Please do so. :-)
@@ +49,5 @@
> +for i in ${icu_dir}/source/data/zone/*.txt
> +do
> + grep -E '^ "meta:' $i > /dev/null
> + if [ $? -eq 0 ]; then
> + sed -i '/^ zoneStrings/, /^ "meta:/ {
IRC alleges: "I believe that's: between lines matching zoneStrings and meta: if the line matches zoneStrings, print; if the line matches meta, print; otherwise delete". That would correspond with the patch changes, at least based one examining one or two files. Is that description correct? If so add a comment explaining this. I propose the following:
"""
Between lines matching the given zoneStrings and meta patterns, inclusive: if the line matches the given zoneStrings pattern, include (print) it; if the line matches the given meta pattern, include (print) it; otherwise remove (delete) it.
"""
Attachment #8691695 -
Flags: review?(jwalden+bmo) → review+
Comment 8•9 years ago
|
||
Comment on attachment 8691696 [details] [diff] [review]
Part 2. Remove cities from ICU data
Review of attachment 8691696 [details] [diff] [review]:
-----------------------------------------------------------------
rs=me assuming the previous patch's comments from me understood the patch and its effects correctly.
Attachment #8691696 -
Flags: review?(jwalden+bmo) → review+
Comment 9•9 years ago
|
||
Also, it'd be nice to sync this up with what v8 does, so the two can be compared by the interested reader. Did the sed command do something like what v8 does? Could you include a link to what v8 does in the patch, so the interested reader can easily compare the approaches?
Comment 10•9 years ago
|
||
OK, so please file something upstream in ICU. You might add comments to http://bugs.icu-project.org/trac/ticket/10922 - we need to get requirements like this. I said the same to Chrome people.
The internals of ICU's data should NOT be considered stable.
Comment 11•9 years ago
|
||
FYI, these patches are going to be obsoleted by bug 1239083.
Depends on: 1239083
Assignee | ||
Comment 12•8 years ago
|
||
Currently our implementation of ECMA-402 supports Etc/UTC only.
But, ECMA-402 2.0 (http://www.ecma-international.org/ecma-402/2.0/#sec-time-zone-names) allows IANA Time Zone Database too. So for 2.0, I might not have to remove these localization data... So I keep open state.
Assignee | ||
Comment 13•8 years ago
|
||
Assignee | ||
Comment 14•8 years ago
|
||
Assignee | ||
Comment 15•8 years ago
|
||
Assignee | ||
Comment 16•8 years ago
|
||
Assignee | ||
Comment 17•8 years ago
|
||
Comment on attachment 8840355 [details] [diff] [review]
Part 1. Remove cities when syncing ICU source code
Update script for ICU 58.2. Cities data seems to be is still unused.
Attachment #8840355 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 18•8 years ago
|
||
Comment on attachment 8840357 [details] [diff] [review]
Part 2. Update ICU source in tree after removing cities data
Update ICU code into our tree after running Part 1's script.
Attachment #8840357 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 19•8 years ago
|
||
Comment on attachment 8840358 [details] [diff] [review]
Part 3. Update icudt58l.dat
Update ICU data into our tree after running Part 1's script.
Attachment #8840358 -
Flags: review?(jwalden+bmo)
Assignee | ||
Updated•8 years ago
|
Attachment #8691695 -
Attachment is obsolete: true
Assignee | ||
Updated•8 years ago
|
Attachment #8691696 -
Attachment is obsolete: true
Comment 20•8 years ago
|
||
Can this stuff still be removed, now that we support the timeZone property on DateTimeFormat options? It looks like all time zone information is recorded in intl/icu/source/data/misc/zoneinfo64.txt now, and so touching these files shouldn't affect our semantics. Am I correct about that? Would like to know that before I try too hard to review any of this.
Flags: needinfo?(m_kato)
Assignee | ||
Comment 21•8 years ago
|
||
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #20)
> Can this stuff still be removed, now that we support the timeZone property
> on DateTimeFormat options? It looks like all time zone information is
> recorded in intl/icu/source/data/misc/zoneinfo64.txt now, and so touching
> these files shouldn't affect our semantics. Am I correct about that? Would
> like to know that before I try too hard to review any of this.
Yes, it works timeZone property like new Date().toLocaleTimeString("en", {timeZone: "America/New_York"}) even if removing localized city name.
Flags: needinfo?(m_kato)
Updated•8 years ago
|
Attachment #8840355 -
Flags: review?(jwalden+bmo) → review+
Updated•8 years ago
|
Attachment #8840357 -
Flags: review?(jwalden+bmo) → review+
Updated•8 years ago
|
Attachment #8840358 -
Flags: review?(jwalden+bmo) → review+
Comment 22•8 years ago
|
||
Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/mozilla-inbound/rev/292d9e369264
Part 1. Remove cities when syncing ICU source code. r=Waldo
https://hg.mozilla.org/integration/mozilla-inbound/rev/6696016a0198
Part 2. Update ICU source in tree after removing cities data. r=Waldo
https://hg.mozilla.org/integration/mozilla-inbound/rev/8c51fd25a389
Part 3. Update icudt58l.dat. r=Waldo
Assignee | ||
Comment 23•8 years ago
|
||
ah, I will back out due to confict updating with Bug 1343493. After recreate dat file, land again.
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/1c9c38cdeac8ab930c62b8c7492fa557afd4a691
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/aa81a5b064ea43d2ec0379734788369e403ea3b8
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/94985ca794f129d05880f8cb035430664411dd24
Comment 24•8 years ago
|
||
do we know how much this shaves off of the apk size hit of ICU?
Comment 25•8 years ago
|
||
Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/mozilla-inbound/rev/45e867a1c89e
Part 1. Remove cities when syncing ICU source code. r=Waldo
https://hg.mozilla.org/integration/mozilla-inbound/rev/c056f2674719
Part 2. Update ICU source in tree after removing cities data. r=Waldo
https://hg.mozilla.org/integration/mozilla-inbound/rev/cc40078f0ac6
Part 3. Update icudt58l.dat. r=Waldo
Assignee | ||
Comment 26•8 years ago
|
||
(In reply to Zibi Braniecki [:gandalf][:zibi] from comment #24)
> do we know how much this shaves off of the apk size hit of ICU?
around 140KB.
Comment 27•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/45e867a1c89e
https://hg.mozilla.org/mozilla-central/rev/c056f2674719
https://hg.mozilla.org/mozilla-central/rev/cc40078f0ac6
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Comment 28•8 years ago
|
||
Some apk size wins from this:
== Change summary for alert #5297 (as of March 03 2017 04:57 UTC) ==
Improvements:
0% installer size summary android-4-0-armv7-api15 opt 34966457.08 -> 34834684.25
0% installer size summary android-api-15-gradle opt 35323165.33 -> 35193592.33
0% installer size summary android-4-0-armv7-api15 debug 36108531.42 -> 35978278.67
0% installer size summary android-4-2-x86 opt 37471828.38 -> 37337097.58
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=5297
You need to log in
before you can comment on or make changes to this bug.
Description
•