lhmouse/asteria

Optimization records

Opened this issue · 3 comments

callgrind

Some obvious issues:

  • 1. Memory allocation of stacks and contexts also costs very much, but it can be mitigated by linking against tcmalloc.
  • 2. The cost of construction (17.28%) and destruction (10.52%) of an Executive_Context for a function call is too high.
  • 3. There are too many (2.5x plain calculation) name lookups for local variables, and the cost (18.00%) is non-negligible.

Looks like we can save ~10% by making all reference counts non-atomic. Replacing all of them is of course impractical, but can we replace some of them?