Friday, August 4, 2017

Log 080417

Well. I don't feel like doing much. I registered an account at readthedocs and started thinking a bit about performance. On a small test example, determine the length of a list of a million numbers, the interpreter runs in seventeen seconds whereas the Glasgow Haskell interpreter runs in around a second. 17x slower.

The hotspot is, of course, the bytecode interpreter.

There are a number of things I can do to gain some performance:
  1. Change the register storage from a container to an array.
  2. Fix the amount of copying. (The 'clone' method.)
  3. Expand the bytecode a bit since it's minimal but not fast.
  4. Use multiple inheritance to remove an indirection from arrays of objects.
  5. Write my own reference counting object.
I changed a few lines of code and implemented the first two steps. Performance increased from seventeen to ten seconds on the example.

No comments:

Post a Comment