Instead of
producing
[
[RULE_START, 1],
[SELECTOR, 'body'],
[PROPERTY, 'color'],
[VALUE, 'red']
[RULE_END]
]
It could instead produce
HEAP = ['body', 'color', 'red']
[
RULE_START, 0,
SELECTOR, 0,
PROPERTY, 1,
VALUE, 2,
RULE_END, 2
]
Where the ints 0,1,2 are memory addresses for the corresponding values in the HEAP.
This way you can use a flat Uint32Array typed array for maximum throughput on performance.
Instead of
producing
It could instead produce
Where the ints
0,1,2are memory addresses for the corresponding values in theHEAP.This way you can use a flat
Uint32Arraytyped array for maximum throughput on performance.