Repository navigation
Settle the native read timing test on paired rounds, and count the case work - #96
Merged
Merged
Conversation
…se work The test "a read by name is no slower than it was" took the fastest before and the fastest after over ten rounds, each from one object built once, and failed when the after was more than a tenth slower. Both read a key found as given, so both run the same code, and the gap between them is the runner's noise. On macOS with Node.js 24 that gap reached 1.373 against the bound of 1.1, and the test failed 2 of 20 runs there. The test now times a before and an after side by side in each round, builds each pair fresh, takes the middle of 200 rounds, measures again once when over the bound, and allows 1.05, as the dictionary timing test in the engines package does. A new test counts the reads that look at letter case, which checks exactly that a read finding its key as given never does.
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.
The problem
The full build of #94,
run 43436807511,
failed on macOS_Node_24 in a test #94 does not touch,
the time of a read with the native engine › a read by name is no slower than it was, atdevice-detection/fiftyone.devicedetection.onpremise/tests/propertyNameCaseNative.test.jsline 164 at 24592acb.The test came with #68.
"Before" is the Element Data with a
getInternalIgnoringCasethat findsnothing, and "after" is the Element Data as it is. The key read,
ismobile,is found as given, and
AspectData.getcallsgetInternalIgnoringCaseonlywhen
getInternalfinds nothing(
aspectData.jslines 75 to 90),so before and after run the same code. The test took the fastest before
over ten rounds and the fastest after over ten rounds, each from one object
built once, and failed when after was more than a tenth over before. The
difference it measures is the runner's noise, not the code.
Each runner's measurements
All of these are after over before, from the test as it is on
rc.From the logs of the 58 full build and nightly runs since #68 merged, 293
measurements in all.
Run 43443859591
ran the test 20 times on each of the 8 runners, with the flags of the
repository's
unit-testscript and the data file CI uses. This is the red.It failed 2 of 20 times on macOS with Node.js 24, where the ratio reached
1.373, and passed every run elsewhere.
The same run measured the read the way the dictionary timing test in
pipeline/fiftyone.pipeline.engines/tests/engines.test.jshas done since#84, 15 times on each
runner. Each round times a before and an after side by side and keeps its own
ratio, each of 10 pairs is built fresh, and the middle of the 200 rounds of
2,000 reads decides. It also measured a read that folds letter case inside
getInternal, which is the slowdown the timing is there to catch.What changed
In
propertyNameCaseNative.test.jsonly, following #84.a read that finds its key as given never looks at letter caseis new.It counts calls to
getInternalIgnoringCaseon the native Element Data. Aread of
ismobilemust make none and a read ofIsMobileexactly one.This is the guarantee Compare property names ignoring case, in the restricted list and in every read #68 gave, checked with no clock.
a read by name is no slower than it wasstays as a backstop for aslowdown the count cannot see, such as letter case folded inside
getInternal. It now times each pair side by side in each round, builds10 pairs fresh, takes the middle of 200 rounds of 2,000 reads, measures
again once when over the bound and takes the better of the two, and
allows 1.05. Same code measured at most 1.040 on any runner, and folding
case measured over 1.05 on every runner but macOS, where it measured from
1.032 and the count is the exact check. The test has a timeout of 120
seconds, as a second measurement doubles its time.
range of the rounds.
How it was verified
The red is the table above from
run 43443859591,
where the test as it is on
rcfailed 2 of 20 times on macOS with Node.js 24.Run 43473620570
ran the test file at the head, 1ef641c, 20 times on each of the 8 runners
with the same flags and data file, and
eslinton it. All 160 runs passed,each with the 5 tests of the file, none needed the second measurement, and
eslintis clean.The full build of this draft,
run 43473656997,
passed. All 8 Ubuntu, Ubuntu ARM, Windows and macOS jobs on Node.js 22 and
24 succeeded, the six Ubuntu, Ubuntu ARM and Windows jobs each with 1,356
unit tests passed and the two macOS jobs each with 1,357, all with 132
integration tests passed, and all 9
Setting 'PullRequestSha'lines are1ef641c0. Compare Performance and Complete passed.What remains