Skip to content
Snippets Groups Projects
Select Git revision
0 results

interpret_functions.h

  • Per Hedbor's avatar
    4ec32c79
    Optimized access to private/final global variables · 4ec32c79
    Per Hedbor authored
    Especially the machine code version is now significantly faster, it
    will simply read the variable directly from the known byte offset
    instead of calling a function that resolves it in the vtable.
    
    Gives about a 20x speedup of trivial code along the lines of
    globala = globala + globalb;
    
    Also tried to disable some of the optimizations that causes lvalues to
    be generated instead of the desired global/assign_global opcodes.
    
    For now this is only done if the global variabeles are known to not be
    arrays, multiset, strings, mapping or objects, since those
    optimizations are needed to quickly append things to arrays (and
    mappings/multiset, but that is less common. It is also needed for
    destructive modifications of strings, something that is even less
    common).
    4ec32c79
    History
    Optimized access to private/final global variables
    Per Hedbor authored
    Especially the machine code version is now significantly faster, it
    will simply read the variable directly from the known byte offset
    instead of calling a function that resolves it in the vtable.
    
    Gives about a 20x speedup of trivial code along the lines of
    globala = globala + globalb;
    
    Also tried to disable some of the optimizations that causes lvalues to
    be generated instead of the desired global/assign_global opcodes.
    
    For now this is only done if the global variabeles are known to not be
    arrays, multiset, strings, mapping or objects, since those
    optimizations are needed to quickly append things to arrays (and
    mappings/multiset, but that is less common. It is also needed for
    destructive modifications of strings, something that is even less
    common).