-
Notifications
You must be signed in to change notification settings - Fork 52
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
Investigate terms being processed in tick #1560
Comments
Yes, you're probably right, though on some level I don't know how well we can reasonably optimize the situation where multiple robots import the same file. In general, if robot A and robot B both import However, I suppose in the special case that a bunch of robots are created as part of a scenario description and all import the same file, we should be able to only parse & process the file once. |
Yes, in this case parsing an unchanged file 242 times is a bit silly. 😅 If import works at parse time then all imports of the same file that are parsed at same time can reuse the result, no? But at least the same robot template should. |
Yes, good point. I will get back to hacking on |
A cache that allows re-use of a parsed and processed file among multiple robots should be keyed by the SHA1 of the file's contents. This will properly invalidate it if edited between uses. |
Sure, though that would still require reading the file every time to calculate its SHA1 hash. If we're reading the entire file from disk anyway I don't know how much time we really save by not parsing + processing it. Perhaps a better idea would be to key the cache on file modification time. |
Linking #495 here since ideally solving that should solve this issue as well. |
Describe the bug
It seems we might be too lazy with term processing, leading to terms being repeatedly processed during the tick:
To Reproduce
Profile the non-inlined version in #1556 (comment).
Add a
cabal.project.local
file like this one:Then run:
Expected behavior
I would expect there to be no (significant)
runParser
in tick profile, that should be done ages ago ininitAppState
.The text was updated successfully, but these errors were encountered: