-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Execution-Top.fs has code that repeatedly re-parses the assembler code to generate a runnable image. the repetition is needed because symbols can have arbitrary forward references. In the normal use case where only a few lines of the program have changed this should not be needed. Instructions without symbols (most of them) do not need to be re-parsed. In fact whole code segments without symbols can be memoised in a pre-parsed and relocatable form and added to the image (in loadImage) in a single operation.
Memoisation is a great technique for speeding up functional code since it is a local change that is provably safe (even though it uses mutable state).
Use memoisation to speed up parsing of long programs (like the sample code from the about menu).