neo-one icon indicating copy to clipboard operation
neo-one copied to clipboard

Optimize the compiler

Open spencercorwin opened this issue 4 years ago • 4 comments

Description

Our compiler emits too much bytecode. Optimize it.

spencercorwin avatar Apr 02 '20 05:04 spencercorwin

See #2095 for potentially helpful info

spencercorwin avatar Jul 15 '20 21:07 spencercorwin

Note from call with DiCarlo on 07/28/20: optimizing the compiler does NOT necessarily mean using the existing (or new) VM instructions to perform the same logic with less instructions. It means taking the outputted bytecode and then optimizing that into better bytecode. For example, analyzing the bytecode and finding two identical chunks of bytecode, which can then just be pointed to whenever it needs to be called. High level TypeScript code to low-level bytecode is not the place to focus on. The place to focus is "standard" bytecode to bytecode optimizations.

spencercorwin avatar Jul 28 '20 19:07 spencercorwin

More ideas from me while working on Neo3 compiler upgrade:

  • Keep track of scope with other stack? Like the try stack?
  • Stack abstraction in an array of stack items?
  • Only initialize a certain number of static slots as opposed to all the slots?
  • Optimize jumps better by using short jumps/calls instead of always using JMP_L

spencercorwin avatar Dec 18 '20 00:12 spencercorwin

https://www.lihaoyi.com/post/HowanOptimizingCompilerWorks.html

spencercorwin avatar Dec 28 '20 06:12 spencercorwin