-
Notifications
You must be signed in to change notification settings - Fork 271
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
Assortment of optimizations #5213
base: trunk
Are you sure you want to change the base?
Conversation
|
1a67a79
to
be463b6
Compare
@@ -163,12 +165,12 @@ debugM flag msg a = | |||
debugLog :: DebugFlag -> String -> a -> a | |||
debugLog flag msg = | |||
if shouldDebug flag | |||
then pTrace msg | |||
then trace msg |
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.
Calling pTrace
on something that's already a string, tries to parse it like Show output and ends up hiding bits and pieces of it randomly :'(
be463b6
to
174f7fa
Compare
@ChrisPenner Any idea why CI / run transcripts (windows-2019) (pull_request) failed on |
Oh strange; I wonder if it inserted them so close that they have the same timestamp and sqlite is sorting them out of order 🤔 BTW not even sure if this PR is worth merging, conceptually this should be a speed up, but the real-world numbers aren't super significant. |
Overview
Adds a couple optimizations and some debugging stuff.
deepTime
which times not only the monadic action, but also deeply forces the returned argument. This gives a much more accurate depiction of the amount of time a given thing takes.unsafeTime
, I tested it, and as we presumed, it's just broken.deepTime
on a Names object, since that's where most of my profiling work has been lately 🙃 ; we can add more as necessary.pTrace
'ing strings would just erase part of them.deepEvaluate
to the Debug module, it can help with determining when something is slow.O(freeVars * names)
to ~freeVars * log(names)
Implementation notes
The only one that has an interesting implementation is
findMatchingTermSuffixes
; so I'd recommend checking that out.Test coverage
Benchmarked against 0.5.24, I cloned nimbus, then
edit.namespace
, here's the time it took to parse the scratchfile:So not a crazy difference from project-root, but still saves us a second or so.