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

Bug.fix branch favoring issues #28

Closed

Conversation

joshuabates
Copy link
Collaborator

No description provided.

@joshuabates joshuabates requested a review from jneen April 13, 2021 19:38
http://jneen.net/ added 2 commits June 22, 2021 15:16
* the results of partial evaluation are now stored on an instance
variable on the node, so it does not have to be recomputed with a
recursive process
* we no longer drop into *real* evaluation of AND/OR nodes during
partial evaluation, saving another entire branch of recursion.

These two changes mean the algorithm is now linear. This can be verified
by adding a `puts` to the #value method of `AST::Or` and running
`PERF_SIZE=<your-input-size> rspec -t perf | wc -l`, and verifying the
number of times #value is called has a linear relationship to the input
size number. We used the same method to verify that the previous code
was superlinear (likely exponential).
@jneen
Copy link
Contributor

jneen commented Oct 21, 2021

Closing as we seem to have merged these commits.

@jneen jneen closed this Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants