[BinAST] Reduce the amount of allocation/free in context parser
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
People
(Reporter: arai, Unassigned)
References
Details
While reading BinAST context format, allocation/free frequently happens because of Vector
and HashTable
used while reading header,
and that results in locking Mutex
frequently inside mozjemalloc.
We should try reducing the call for malloc/free, maybe by using different pre-allocated size, or different allocator/AllocPolicy, or adding yet another allocator/AllocPolicy with temporary space?
For what it's worth, normally, everything is Vector
now.
I have tried to increase pre-allocated size, but doing it as a simple hack killed the stack :/
Reporter | ||
Comment 2•5 years ago
•
|
||
Given the following:
- we know the required size at the allocation
- no reallocation happens
- many things have same life time
adding dedicated AllocPolicy
with temporary space might work.
Also, about pre-alocated size, given allocating SingleLookupHuffmanTable.{values,saturated}
with 1 happens frequently, we could add non-Vector
based variant with fixed size array would work nicely.
Comment 3•3 years ago
|
||
Resolving BinAST bugs as Incomplete.
Description
•