Skip to content

peterbe/optimize-titles.json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

optimize titles.json

In Yari, as a build step we produce a build/$locale/titles.json file which get downloaded, with XHR, in the browser so it matters that it's not unnecessarily big which means due to network speed would be bad user experience.

To run the experiment

Run:

python 1.py  # generates 1.json
python 2.py  # genetates 2.csv
python 3.py  # generates 4.json
python 4.py  # generates 4.json

Produce the table with:

python table.py

Or just use ls:

ls -ltrS

Results

One version of the results as of today:

Exclusively gzip sizes:

Just the .gz versions:

▶ ls -ltrS *.gz
-rw-r--r--  1 peterbe  staff  155639 Jul 15 14:05 5.json.gz
-rw-r--r--  1 peterbe  staff  158917 Jul 15 12:05 4.json.gz
-rw-r--r--  1 peterbe  staff  195261 Jul 15 11:59 2.csv.gz
-rw-r--r--  1 peterbe  staff  209658 Jul 15 11:56 1.json.gz
-rw-r--r--  1 peterbe  staff  213309 Jul 15 12:00 3.json.gz
-rw-r--r--  1 peterbe  staff  213342 Jul 15 11:54 0.json.gz

And pretty-printed sizes:

▶ ls -ltrSh *.gz
-rw-r--r--  1 peterbe  staff   152K Jul 15 14:05 5.json.gz
-rw-r--r--  1 peterbe  staff   155K Jul 15 12:05 4.json.gz
-rw-r--r--  1 peterbe  staff   191K Jul 15 11:59 2.csv.gz
-rw-r--r--  1 peterbe  staff   205K Jul 15 11:56 1.json.gz
-rw-r--r--  1 peterbe  staff   208K Jul 15 12:00 3.json.gz
-rw-r--r--  1 peterbe  staff   208K Jul 15 11:54 0.json.gz

Conclusion

The cheapest thing you can do is to round the popularity numbers down to fewer significant figures. And to omit the popularity when it's 0 anyway doesn't hurt.

Releases

No releases published

Packages

No packages published

Languages