-
Enhancement
-
Resolution: Fixed
-
P4
-
13
-
b13
In ClassVerifier and SignatureStream, we currently do a lot of Symbol lookups. These Symbols are then kept alive incrementing refcount when necessary, adding them to a GrowableArray and decrementing refcount in each respective destructor.
A few optimization have been identified which improve things in general:
- do not add permanent symbols to the keepalive list -- this is helped along by ensuring all permanent symbols actually return true when calling is_permanent (add Symbol::make_permanent)
- maintain a one-element lookup cache to avoid a fraction of all lookups (experimental data shows that repeated Symbols in signatures are quite common, and the number of avoided lookups for a single class can reach thousands)
- narrow down the initial sizes of the GrowableArrays since we'll only add a fraction of the number of Symbols to them
A few optimization have been identified which improve things in general:
- do not add permanent symbols to the keepalive list -- this is helped along by ensuring all permanent symbols actually return true when calling is_permanent (add Symbol::make_permanent)
- maintain a one-element lookup cache to avoid a fraction of all lookups (experimental data shows that repeated Symbols in signatures are quite common, and the number of avoided lookups for a single class can reach thousands)
- narrow down the initial sizes of the GrowableArrays since we'll only add a fraction of the number of Symbols to them