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
{{ message }}
This repository has been archived by the owner on Nov 15, 2017. It is now read-only.
HTTP Switchboard is already significantly more efficient than all popular blockers memory and CPU wise. However this does not mean I should stop looking for further improvement.
Hostnames in liquid-dict.js are indexed using a 6- to 7-character string hash. This works toward reducing memory footprint given that out-of-the box, there are nearly 60,000 distinct hostnames in this dictionary (one dict entry can contains many hostnames).
Since a while, I've been entertaining the idea of hashing into a single (unicode) character, as this would benefit both memory and CPU efficiency, but I needed a prototype to roughly validate the idea.
So I now have a prototype, and it shows that this works, and there is a gain in both CPU and memory footprint (see http://jsperf.com/makekey-concat-vs-join/3 for the CPU aspect).
Current limitation of the new hashing function is that a hostname can't be longer than 255 characters (if it ever become an issue, worst-case is to generate a two-char hash instead of one-char).
The text was updated successfully, but these errors were encountered:
To validate that one-char hashing works as well as the 6-/7-char hashing, I expect both versions to result in exactly the same dictionary topology, the only difference being the key values. So I just need to validate this using temporary code to compare both the old and new dict.
HTTP Switchboard is already significantly more efficient than all popular blockers memory and CPU wise. However this does not mean I should stop looking for further improvement.
Hostnames in liquid-dict.js are indexed using a 6- to 7-character string hash. This works toward reducing memory footprint given that out-of-the box, there are nearly 60,000 distinct hostnames in this dictionary (one dict entry can contains many hostnames).
Since a while, I've been entertaining the idea of hashing into a single (unicode) character, as this would benefit both memory and CPU efficiency, but I needed a prototype to roughly validate the idea.
So I now have a prototype, and it shows that this works, and there is a gain in both CPU and memory footprint (see http://jsperf.com/makekey-concat-vs-join/3 for the CPU aspect).
Current limitation of the new hashing function is that a hostname can't be longer than 255 characters (if it ever become an issue, worst-case is to generate a two-char hash instead of one-char).
The text was updated successfully, but these errors were encountered: