Repository navigation
test(ics): check the parse cache directly instead of timing it - #727
Merged
Merged
Conversation
"should benefit from caching on repeated parsing" required the cached parse to take under half the time of the first one. Both take about a millisecond, and the cache hit still hashes the whole content, so a GC pause on CI flips the result (it failed PR #725's CI with 1.3 ms vs 2.8 ms). Assert the cache behaviour instead: the second parse of the same content doesn't parse again (unfoldLines runs once), the cache holds one entry, and the result is a copy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ICS caching test required the cached parse to take under half the time of the first one. Both take about 1 ms, and a cache hit still hashes the whole content, so CI timing noise flips the result: it failed #725's CI with 1.3 ms vs 2.8 ms. Like #709 did for the Chinese-tag timing test, this now asserts the behaviour instead:
unfoldLinesruns once);Test-only change.