From 3ce02f3a69f25a4f1d94fcfea4215f260c15dc42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janosch=20Mu=CC=88ller?= Date: Wed, 1 Feb 2023 22:03:00 +0100 Subject: [PATCH] Update docs --- CHANGELOG.md | 9 +++++++-- tasks/benchmarks/log | 12 ++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1ef8e1..c68d9f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Fixed +### Added +- `Regexp::Lexer.lex` now streams tokens when called with a block + - it can now take arbitrarily large input, just like `Regexp::Scanner` + - this also slightly improves `Regexp::Parser.parse` performance + - note: `Regexp::Parser.parse` still does not and will not support streaming - improved performance of `Subexpression#each_expression` -- improved `Regexp::Parser.parse` performance by about 20% +- minor improvements to `Regexp::Scanner` performance +- overall improvement of parse performance: about 10% for large Regexps ## [2.6.2] - 2023-01-19 - [Janosch Müller](mailto:janosch84@gmail.com) diff --git a/tasks/benchmarks/log b/tasks/benchmarks/log index 62441b8..0e7ace6 100644 --- a/tasks/benchmarks/log +++ b/tasks/benchmarks/log @@ -2,13 +2,13 @@ Results of rake:benchmark on ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm6 Parsing a minimal Regexp - Scanner::scan: 32710.2 i/s - Lexer::lex: 31091.8 i/s - same-ish: difference falls within error - Parser::parse: 27097.3 i/s - 1.21x (± 0.00) slower + Scanner::scan: 32069.4 i/s + Lexer::lex: 30700.6 i/s - same-ish: difference falls within error + Parser::parse: 26248.5 i/s - 1.22x (± 0.00) slower Parsing a complex Regexp (URI.regexp) - Scanner::scan: 877.0 i/s - Lexer::lex: 545.2 i/s - 1.61x (± 0.00) slower - Parser::parse: 294.7 i/s - 2.98x (± 0.00) slower + Scanner::scan: 843.4 i/s + Lexer::lex: 546.3 i/s - 1.54x (± 0.00) slower + Parser::parse: 332.5 i/s - 2.54x (± 0.00) slower