leptris 1.9.26-x86_64-linux → 1.9.27-x86_64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/sax/parser.rb +15 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 760abc25eb676748e61adf0d0bf4a21be7f14ece8d3e55922ad8d99e6f38a696
|
|
4
|
+
data.tar.gz: 4841c5f79520f5588731a0a7a6f84ce93350d718e88580d3272307fb20e09c07
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '01828a6e548f6460c32399a4b797f0ce02a62b1acf87e1c12cbb17e36d159b2081587ffce4f910d504c516bd265ab805be804d70851b4347d2051fc24e9ce2e9'
|
|
7
|
+
data.tar.gz: 9b92e65a4d4cc206921bfd08a7f711d1f5fbe3df994eb6b2a6aca111b659391e5ad70b6a5bd60979dc777a25b8597e05eb2f7a1bc83d9daccc27cb6f64e42393
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,29 @@ All notable changes to Leptris will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.9.27] - 2026-08-28
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Arity-declared attrs interest in SAX** (round XIX's policy
|
|
13
|
+
completed): a handler whose `start_element` takes exactly one
|
|
14
|
+
argument declares name-only — the attribute walk (2N pointer
|
|
15
|
+
reads + N string pairs per start) never runs. Measured
|
|
16
|
+
elements-only on big.xml: 116 -> **40 ms per parse (2.9x; the
|
|
17
|
+
no-walk ceiling is 3.7x)**. This also fixes a crash: 1-argument
|
|
18
|
+
`start_element` handlers previously raised ArgumentError because
|
|
19
|
+
the callback always dispatched both arguments (Nokogiri raises
|
|
20
|
+
there too; we now honor the signature). Optional-argument and
|
|
21
|
+
splat handlers keep receiving pairs exactly as before.
|
|
22
|
+
|
|
23
|
+
### Meta
|
|
24
|
+
|
|
25
|
+
- Upstream check: no libleptris 1.9.8 exists (tarball probe 404s);
|
|
26
|
+
1.9.7 remains latest. Two perf hypotheses benchmarked and
|
|
27
|
+
retired this round: `Element#content` is already a memoized
|
|
28
|
+
one-C-call read, and `Node#traverse`'s C callback dispatch
|
|
29
|
+
(181 ms) beats Ruby children-recursion (551 ms) 3x — both stay.
|
|
30
|
+
|
|
8
31
|
## [1.9.26] - 2026-08-28
|
|
9
32
|
|
|
10
33
|
### Added
|
data/lib/leptris/version.rb
CHANGED
|
@@ -105,9 +105,21 @@ class Leptris::XML::SAX::Parser
|
|
|
105
105
|
end
|
|
106
106
|
|
|
107
107
|
if overridden?(:start_element)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
# Arity-declared interest: a start_element that takes exactly
|
|
109
|
+
# one argument declares name-only — the attr walk (2N pointer
|
|
110
|
+
# reads + N string pairs per start; 3.7x of an elements-only
|
|
111
|
+
# parse on the 1.9 MB stream) never runs. It is also the only
|
|
112
|
+
# way a 1-arg handler can receive events: the two-argument
|
|
113
|
+
# call raises ArgumentError.
|
|
114
|
+
if @document.method(:start_element).arity == 1
|
|
115
|
+
s[:start_element] = callback(:void, [:pointer, :string, :pointer]) do |_, name, _|
|
|
116
|
+
handler.start_element(utf8(name))
|
|
117
|
+
end
|
|
118
|
+
else
|
|
119
|
+
s[:start_element] = callback(:void, [:pointer, :string, :pointer]) do |_, name, attrs_ptr|
|
|
120
|
+
attrs = walk_attr_array(attrs_ptr)
|
|
121
|
+
handler.start_element(utf8(name), attrs)
|
|
122
|
+
end
|
|
111
123
|
end
|
|
112
124
|
end
|
|
113
125
|
|