[fix] fn:random-number-generator#1 spec compliant#3916
Draft
line-o wants to merge 7 commits intoeXist-db:developfrom
Draft
[fix] fn:random-number-generator#1 spec compliant#3916line-o wants to merge 7 commits intoeXist-db:developfrom
line-o wants to merge 7 commits intoeXist-db:developfrom
Conversation
Test all allowed seed types and also rejections.
random-number-generator finally accepts all AtomicTypes as seeds. All seeds will be turned to strings and then hashed with djb2. This algorithm is a good trade-off in terms of spread and speed. The overall performance increase is significant. Test runs with this simple approach are 20% faster than even checking the type and switching the method based on that type.
- all method arguments marked final - use new switch where possible and useful - remove redundant final keyword for static methods which cannot be overridden - replace old non-javadoc comment blocks with @OverRide annotation
remove unused private methods
Member
Author
|
I will not attempt to fix one of the complexity issues that codacy reports. These functions are hot code and should be handled with utmost care. |
Member
Author
|
I am a little surprised to see that the numbers from the XQTS runner workflow do not seem to match with my local run local
GHA previous
GHA current
|
Member
Author
|
The skips are very different. Maybe we are still using a version of XQTS runner that does not skip static typing? |
Member
Author
|
And once #6128 is merged I will have to rebase. |
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.
Description:
Seeded random-number-generators must be reproducible within a single execution context and are recommended to be reproducible across executions, too.
By using the same efficient hashing algorithm djb2 on the string representation of any atomic value we achieve
both goals with any atomic types given as the seed.
Reference:
XQuery specification: https://www.w3.org/TR/xpath-functions-31/#func-random-number-generator
fixes #3915
fixes #3912
Type of tests:
XQsuite tests