leptris 1.9.40 → 1.9.41
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 +14 -0
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/ffi.rb +12 -5
- 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: a670640aa8b76b1d6f14f1e50b54ac329a477a6f293dc17e710524822690b0d8
|
|
4
|
+
data.tar.gz: cfc26d52da5bba121bfbd2d3424b4aa64acd6feb1c2a9be143f99002d16aa1fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c2707588ab5775016e0bafd1554f05e872ae98f35cd9bf347471172f1f290f0daa2badda34c0dbdefdcd4c959e5ff3b5855ff1c20c034e91cbf3d508559fda74
|
|
7
|
+
data.tar.gz: 5ecbe0965f5e489a9e9eae2fab172a6826a0680ca64856d1a025d822b62c1e88c2badcacd5d6540b5e59144ae6ce5c0311d3e67d012afda5cc9ec0f7804fe566
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ 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.41] - 2026-08-30
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **One thread-local access per children batch**: fetch_children
|
|
13
|
+
re-looked up the scratch hash inside the ints helper on every
|
|
14
|
+
call; both buffers now resolve through a single access (and the
|
|
15
|
+
kinds buffer sizes from the pointers capacity directly). Cold
|
|
16
|
+
full-tree walk: 254 -> 247 ms per big.xml walk (the gap vs
|
|
17
|
+
Nokogiri narrows 1.66x -> 1.56x — the remainder is the binding's
|
|
18
|
+
per-node allocation floor, re-measured and filed upstream as
|
|
19
|
+
leptris/leptris#645 together with the unchanged 1.64x scalar
|
|
20
|
+
XPath gap from #617's other half).
|
|
21
|
+
|
|
8
22
|
## [1.9.40] - 2026-08-30
|
|
9
23
|
|
|
10
24
|
### Changed
|
data/lib/leptris/version.rb
CHANGED
data/lib/leptris/xml/ffi.rb
CHANGED
|
@@ -911,17 +911,22 @@ module Leptris
|
|
|
911
911
|
# (leptris_node_children_ex, 1.9.18 #617) so wrappers skip
|
|
912
912
|
# the per-child get_type dispatch.
|
|
913
913
|
def self.fetch_children(c_ptr)
|
|
914
|
+
# One thread-local access serves both buffers (the helper
|
|
915
|
+
# re-looked it up); the kinds buffer sizes from the POINTERS
|
|
916
|
+
# buffer's capacity — it may have grown past FETCH_INITIAL on
|
|
917
|
+
# earlier use, and C writes one kind per copied child.
|
|
914
918
|
scratch = (Thread.current[:leptris_scratch] ||= {})
|
|
915
919
|
buffer = scratch[:pointers]
|
|
916
920
|
if buffer.nil?
|
|
917
921
|
buffer = scratch[:pointers] =
|
|
918
922
|
::FFI::MemoryPointer.new(:pointer, FETCH_INITIAL)
|
|
919
923
|
end
|
|
920
|
-
# size the kinds buffer from the POINTERS buffer's capacity —
|
|
921
|
-
# it may have grown past FETCH_INITIAL on earlier use, and C
|
|
922
|
-
# writes one kind per copied child
|
|
923
924
|
cap = buffer.size / PTR_BYTES
|
|
924
|
-
kinds =
|
|
925
|
+
kinds = scratch[:ints]
|
|
926
|
+
if kinds.nil? || kinds.size / INT_BYTES < cap
|
|
927
|
+
kinds&.free
|
|
928
|
+
kinds = scratch[:ints] = ::FFI::MemoryPointer.new(:int, cap)
|
|
929
|
+
end
|
|
925
930
|
copied = leptris_node_children_ex(c_ptr, buffer, kinds, cap)
|
|
926
931
|
if copied == cap
|
|
927
932
|
total = leptris_node_children_ex(c_ptr, nil, nil, 0)
|
|
@@ -929,7 +934,9 @@ module Leptris
|
|
|
929
934
|
buffer.free
|
|
930
935
|
buffer = scratch[:pointers] =
|
|
931
936
|
::FFI::MemoryPointer.new(:pointer, total)
|
|
932
|
-
kinds
|
|
937
|
+
kinds.free
|
|
938
|
+
kinds = scratch[:ints] =
|
|
939
|
+
::FFI::MemoryPointer.new(:int, total)
|
|
933
940
|
copied = leptris_node_children_ex(c_ptr, buffer, kinds, total)
|
|
934
941
|
end
|
|
935
942
|
end
|