Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checek and change digits jsf representations #1

Closed
kamil-kielczewski opened this issue Sep 1, 2020 · 2 comments
Closed

Checek and change digits jsf representations #1

kamil-kielczewski opened this issue Sep 1, 2020 · 2 comments

Comments

@kamil-kielczewski
Copy link
Owner

kamil-kielczewski commented Sep 1, 2020

After small statistical experimets it looks like for average code after conversion to base4 the most common character is 1,0,2 and less common is 3.

Check this on popular codefiles (like jquery etc.) - if true, then switch numbers representation to

0 --> 0       jsf:    +!![]
1 --> false   jsf:     +![]
2 --> true    jsf:   +(+[])
3 --> 1       jsf: +(+!![])

This will cause that in bootstrap we need to add .replace(/1/g,3) (because before 0 and 1 have same representation as in jsf) as follows

.replace(/true/g,2).replace(/false/g, 1).replace(/1/g,3)
  1. check how typical 1kB of code is smaller after this change
  2. check how much bootstrap code grows (if only few kB and point 1 is nice, then it is worth to make that change )
@kamil-kielczewski
Copy link
Owner Author

kamil-kielczewski commented Sep 2, 2020

After analyse using this tool now it is clear that it is worth to switch sequence because 0 and 1 appears as first character of coding first 127 ASCII characters ("most popular"). (1 is usually most popular).

Test how big profit we get using fork of this stat tool

@kamil-kielczewski
Copy link
Owner Author

It's not worth doing this (because some codes compres better by one map, other codes by other map) - it's better to focus on task #7 (statistics and dynamic compiler)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant