[BinAST] Optimize HuffmanDictionary.{fields_,listLengths_} initialization code
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox72 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(2 files)
Currently (even after bug 1590683 patch), HuffmanDictionary::HuffmanDictionary
ctor code is like the following:
pushq %rbp
movq %rsp, %rbp
movb $0x0, 0x58(%rdi)
movb $0x0, 0xb8(%rdi)
movb $0x0, 0x118(%rdi)
movb $0x0, 0x178(%rdi)
movb $0x0, 0x1d8(%rdi)
movb $0x0, 0x238(%rdi)
movb $0x0, 0x298(%rdi)
movb $0x0, 0x2f8(%rdi)
movb $0x0, 0x358(%rdi)
movb $0x0, 0x3b8(%rdi)
movb $0x0, 0x418(%rdi)
... (skip 284 lines of movb)
movb $0x0, 0x6ef8(%rdi)
movb $0x0, 0x6f58(%rdi)
popq %rbp
retq
This is initialization of arrays of Variant
s, HuffmanDictionary.{fields_,listLengths_}
, and each operation sets the tag to HuffmanTableUnreachable
.
Given we don't need HuffmanTableValue
to be Variant
after bug 1590683, but just want unused GenericHuffmanTable
uninitialized,
if we store the tag (flag) and the uninitialized array of GenericHuffmanTable
separately,
the operation can be done with smaller code and also maybe quickly.
(we need some special code to manage array of uninitialized/initialized instances tho)
also, if we use something else than Array
, we can remove BINAST_PARAM_NUMBER_OF_*
macros.
Assignee | ||
Comment 1•5 years ago
|
||
when parsing 200 small files, HuffmanDictionary
ctor takes 1.1% of the total time.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D50597
Comment 5•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/50a9344008a3
https://hg.mozilla.org/mozilla-central/rev/d9cf158e085b
Description
•