[BinAST] Make Huffman lookup faster
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox71 | --- | fixed |
People
(Reporter: Yoric, Assigned: Yoric)
References
Details
Attachments
(7 files, 1 obsolete file)
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review |
Huffman lookup is currently O(entries). We can make it O(bit length), possibly even better. Let's do so.
See https://gist.github.com/Yoric/a9267822dee8776186624800169b217c for more details.
Updated•6 years ago
|
| Assignee | ||
Comment 1•6 years ago
|
||
A few changes to HuffmanTableImplementationSaturated:
- we can now create instances of HuffmanTableImplementationSaturated with max bit lengths up to 10;
- we reject cases in which we have more than 256 elements;
- internal indices in HuffmanTableImplementationSaturated are now represented with uint8_t instead of usize_t,
which divides the size of this array by 4 and should improve memory locality.
According to my benchmarking, this decreases duration by ~7%.
Depends on D45644
| Assignee | ||
Comment 2•6 years ago
|
||
| Assignee | ||
Comment 3•6 years ago
|
||
Depends on D45315
| Assignee | ||
Comment 4•6 years ago
|
||
As we intend to have several implementations of Huffman Table depending
on the size of data, we start by introducing a small abstraction
HuffmanTableImplementationGeneric holding a Variant<...> with
possible implementations of Huffman Tables.
In this patch, there is only a single implementation HuffmanTableImplementationMap.
A followup patch will introduce an alternate fast but space-costly optimized for
small tables.
| Assignee | ||
Comment 5•6 years ago
|
||
We introduce a new implementation of Huffman Tables that trades
space for a fast lookup. For the time being, this implementation
is reserved for tables with a max bitlength of 8 or less.
Depends on D45643
| Assignee | ||
Comment 6•6 years ago
|
||
Ok, there's more to do with faster lookup, but according to my benchmarks, this already increases speed by ~14%.
Comment 8•6 years ago
|
||
backed out for build bustages on BinASTTokenReaderContext.h
Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&revision=ebb8ad9cd82eae549eb6e96395fdde61f48fb78a&selectedJob=266480147
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=266480147&repo=autoland&lineNumber=6145
Backout: https://hg.mozilla.org/integration/autoland/rev/e5065ace97fd1e76ff0f5779a5a83d1fad43b523
| Assignee | ||
Comment 9•6 years ago
|
||
Ah, right, forgot to make the constructors explicit. I'm on it.
| Assignee | ||
Comment 10•6 years ago
|
||
| Assignee | ||
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
| Assignee | ||
Comment 13•6 years ago
|
||
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/ea90070799fb
https://hg.mozilla.org/mozilla-central/rev/8191ba5b58da
https://hg.mozilla.org/mozilla-central/rev/0723ca2ce2bb
https://hg.mozilla.org/mozilla-central/rev/9e0541d8cea7
https://hg.mozilla.org/mozilla-central/rev/2f3c022f9315
https://hg.mozilla.org/mozilla-central/rev/97d38d633c8e
https://hg.mozilla.org/mozilla-central/rev/4e6dd979ed23
Updated•6 years ago
|
Updated•5 years ago
|
Description
•