CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 82
Investigate the benefit of the idea of a url packer for when recording net requests #28
Description
Request URLs are responsible for a lot of allocation/deallocation, so saving space on these should help I believe.
Roughly, URL is decomposed in nodes, i.e.
protocol, hostname, path, leaf (the most likely mutated)
A unique runtime id is assigned to each node when they first appear, or the id is looked if the node already exists (except for the leaf portion of the URL, which is rather pointless to compact given its likely uniqueness)
The "packed" URL consist of a concatenation of the runtime id of each node, in order of occurrence. The runtime id itself could be base 64 rather than plain hex conversion.
Example:
Currently:
https://cdn.arstechnica.net/wp-content/themes/arstechnica/assets/images/mobile.png#image
https://cdn.arstechnica.net/wp-content/themes/arstechnica/assets/images/nav-house-sprite.png#image
https://cdn.arstechnica.net/wp-content/themes/arstechnica/assets/images/orange-arrow-bottom-right.png#image
https://cdn.arstechnica.net/wp-content/themes/arstechnica/assets/images/search.png#image
...
After (say using plain hex):
1 F 234 mobile.png#image
1 F 234 nav-house-sprite.png#image
1 F 234 orange-arrow-bottom-right.png#image
1 F 234 search.png#image
...
Where above 1
is https://
, F
is cdn.arstechnica.net
, 234
is /wp-content/themes/arstechnica/assets/images/