Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving re-parse performance #34

Open
tomcl opened this issue Jul 15, 2018 · 0 comments
Open

Improving re-parse performance #34

tomcl opened this issue Jul 15, 2018 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tomcl
Copy link
Collaborator

tomcl commented Jul 15, 2018

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).

@tomcl tomcl added enhancement New feature or request good first issue Good for newcomers labels Jul 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant