new thread •When the system is stressed – overhead of thread scheduling and context switching •The system waste resources for allocating threads instead of doing actual work
hot – it is worth doing multiple optimisations • Tracing will send it to optimising compiler • Creates an even faster version of the code • Tracing pulls it when the function code runs
possible • Relies on input type information collected via inline caches while functions run via the Ignition interpreter. • Generates the best possible code handling the different types it encountered • The fewer function input type variations the compiler has to consider, the smaller and faster the resulting code will be
function input type variations lead to smaller and faster resulting code. •Keeping your functions monomorphic or at least polymorphic •Monomorphic: one input type •Polymorphic: two to four input types •Megamorphic: five or more input types
– it ended up being slower then just use the baseline compiled version • Most browsers and engines will stop trying after several iterations of optimising and de-optimizing
and arguments • Maintains two pointers – Stack Pointer and Base Pointer • Divided into stack frames • No Garbage Collection - self cleaning • Hold the key to the garbage collection process - Starts from active objects that has pointers to the stack.
on the heap • New Space – short lived Objects • Old Space – long lived Objects • Scan on ‘New Space’ called ‘Scavenge’ • Very fast – takes less then a millisecond • Scan on ‘Old Space’ called ‘Mark Sweep’ • Slower scan
‘Scavenge’ Scan To Detect Live Objects On New Space Object survives 2 ‘Scavenge’ scans and still alive Moved To ‘Old Space’ More Space Needed On Old Space Mark Sweep Scan Starts to Free Space On Heap