Add efficiency regression test for the compare editor open path#2796
Open
vogella wants to merge 1 commit into
Open
Add efficiency regression test for the compare editor open path#2796vogella wants to merge 1 commit into
vogella wants to merge 1 commit into
Conversation
e7c2ad3 to
5b10726
Compare
Contributor
CompareOpenEfficiencyTest opens a compare editor end to end and pins three observable contracts with deterministic assertions: how often the element contents are read during a single open (currently 15 times per side), that prepareInput runs exactly once per open, and that it does not run on the UI thread for inputs that can run as a job. With the unified diff preference enabled the test documents that prepareInput currently does run on the UI thread. This records the baseline for the open path performance work. Contributes to eclipse-platform#2795
5b10726 to
2d1ab5b
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Opening a compare editor currently re-reads the compared element contents up to 15 times per side (observed: 15 on Linux and Windows, 9 on macOS), and with the unified diff preference enabled it runs prepareInput synchronously on the UI thread. This adds CompareOpenEfficiencyTest, which opens a compare editor end to end and pins these observable contracts: a bounded number of content reads per open, exactly one prepareInput per open, and preparation off the UI thread for inputs that can run as a job. The read count is asserted as an upper bound because the exact value is platform dependent; the bound is lowered as the follow-up changes for the linked issue remove the redundant reads and fix the unified diff threading. Unlike timing thresholds, these assertions are deterministic, so they are safe to enforce in CI.
Contributes to #2795