Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Duel: nothing to compare |
Add Duel, with 23 benchmarks in duel/ that fail CI when a change makes parsing slower: MultiXML.parse on documents from tiny to large, each shape from benchmark.rb, the namespace, symbolize and typecast options, an IO input, every backend other than Ox, and requiring the library. The Perf workflow compares each pull request with main, each push with the commit before it, and the last release on a schedule. RuboCop now checks .duel.rb too. Duel needs Ruby 3.4 or later, so the Gemfile and Rakefile skip it on older Rubies.
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.
This adds Duel, a gem I wrote to catch performance regressions in CI. On every pull request it runs the benchmarks in
duel/againstmainand the branch side by side, and fails the build if the branch is slower or allocates more.There are 23 benchmarks. Most of them parse documents with the shapes from
benchmark.rb(shallow, deep, attribute-heavy, mixed content, namespaced) at sizes from a tiny document up to a ~55 KB catalog, plus the dasherize, symbolize, typecast, and IO paths. There's one for each backend besides Ox, and one for how longrequire "multi_xml"takes.The benchmarks pin
MultiXML.parser = :ox. Without that, which parser a worker used depended on which XML libraries an earlier benchmark had loaded, and the allocation counts jumped around between runs. The downside is that a change to parser auto-detection isn't covered.To check that it actually catches things, I added an extra allocation to the SAX handler, and Duel failed exactly the libxml SAX and Nokogiri SAX benchmarks. Extra work in the Ox handler failed all 16 parse and typecast benchmarks. Comparing
mainwith itself passed three times in a row.I also excluded
duel/and.duel.rbfrom the gemspec, so they don't end up in the gem.Duel requires Ruby 3.4, so the Gemfile only adds it on 3.4 and newer, and the Rake task is skipped when it isn't installed. Everything else still works on older Rubies.