-
-
Notifications
You must be signed in to change notification settings - Fork 905
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: RelaxNG.read_memory is now reliable
On both JRuby and CRuby impls, replace the native `read_memory` method from XML::Schema and XML::RelaxNG with a ruby method that uses `from_document`. `read_memory` was buggy on both platforms, but especially on the JRuby impl. This is comparable in performance on CRuby. From a benchmark taken before this change: Warming up -------------------------------------- Schema.new 1.219k i/100ms Schema.from_document 1.258k i/100ms Schema.read_memory 1.118k i/100ms Calculating ------------------------------------- Schema.new 12.160k (± 8.3%) i/s - 121.900k in 10.093638s Schema.from_document 12.216k (± 8.6%) i/s - 122.026k in 10.059696s Schema.read_memory 12.790k (±10.7%) i/s - 127.452k in 10.105931s Comparison: Schema.read_memory: 12789.6 i/s Schema.from_document: 12215.9 i/s - same-ish: difference falls within error Schema.new: 12160.1 i/s - same-ish: difference falls within error IMHO the resulting code is less buggy and easier to maintain, and the slight (if any) performance hit is worth it. Closes #2113 Closes #2115
- Loading branch information
1 parent
25fb309
commit 49c5b8b
Showing
7 changed files
with
47 additions
and
87 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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