-
Notifications
You must be signed in to change notification settings - Fork 104
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
Temporary fix to speed up canAvoidInstr
#1699
Conversation
Pull Request Test Coverage Report for Build 8881462669Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for a hotfix, thanks!
Though I'd remove isEnvDependent
entirely and move the logic to the node creator function instead. What do you think? Do you foresee any more changes to this logic? You mentioned this is just a basic check (for the demo the other day) right? What future more "advanced" checks might there be?
Also, can I check what's left of this PR before it can be marked as ready?
Thanks!
@RichDom2185 Yes, I think that moving the logic to the node creator function is what should ultimately be done (for now this is just a basic, non-exhaustive check). but I won't be able to work on it very soon (due to exams). Until then I think it is still considerably slow with this fix though so I'm trying other ways to speed it up a bit more first. If you think it's fine for now then I'll mark it as ready |
…ource-academy/js-slang into cse-machine-simplify-env-instr
@RichDom2185 I just pushed a second approach, this seems to fix the efficiency issue, and I think it's closer to what would be done when we move the logic to the node creator function eventually. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor nits, otherwise all good, thanks a lot!
src/cse-machine/utils.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with this as long as it is a temporary hotfix. Please create an issue to migrate this to the node creator in the future.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #1702.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this first so that the other CI workflows can complete quickly…
Part of #1698 (does not close it fully due to the comment above). |
Following the fact that the check
canAvoidInstr
implemented in previous PR #1687 is too slow, this PR implements a temporary fix by caching the result ofisEnvDependent
as a field for eachControlItem