leptris 1.9.413.0-arm-linux → 1.9.415.0-arm-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/Rakefile +1 -1
- data/lib/leptris/version.rb +1 -1
- data/lib/libleptris.so +0 -0
- data/vendor-src/README.md +1 -1
- data/vendor-src/libleptris/CHANGELOG.md +18 -0
- data/vendor-src/libleptris/CMakeLists.txt +1 -1
- data/vendor-src/libleptris/README.adoc +49 -5
- data/vendor-src/libleptris/benchmarks/modification/bench_append_attr_pugixml.cpp +98 -38
- data/vendor-src/libleptris/src/leptris/flat/direct_parse.c +41 -24
- data/vendor-src/libleptris/src/leptris/memory/pool.c +16 -6
- data/vendor-src/libleptris/vcpkg.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '09b5d7c403eb92a80a43867b631a1876bd5d9271193f6e9a06605e5d25293ffb'
|
|
4
|
+
data.tar.gz: 9830396619bd6a9c3adea52c7e84514e8092083d8d4d2602be0d6c8dcca27096
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 251683bf2865947f2ee7b57c1c5fc26651e66f12524484fc12f1b155512f7c0c17291fccca5d73cbf622fc3cd1c9caa11f7f20a72c627dd985bc1f404190c7c7
|
|
7
|
+
data.tar.gz: b38a8dcf4050fcc2d15a308cfe42390df09af33a2d78139a6bf3af63d844ca32420714f09f90ee12be1ad835341f1e301b87cedb10a52544288bc4dd5bf786ba
|
data/Rakefile
CHANGED
|
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec)
|
|
|
8
8
|
# Pin for `rake compile` and the platform-gem builds. Keep in lockstep
|
|
9
9
|
# with .github/workflows/build.yml (which calls `rake compile`) and the
|
|
10
10
|
# CHANGELOG when libleptris releases.
|
|
11
|
-
LIBLEPTRIS_VERSION = "1.9.
|
|
11
|
+
LIBLEPTRIS_VERSION = "1.9.415"
|
|
12
12
|
# Vendored alongside libleptris for fn:normalize-unicode (TODO
|
|
13
13
|
# .restructure/20): built per platform with a RELOCATABLE @rpath
|
|
14
14
|
# install name, loaded by ffi.rb before libleptris so the
|
data/lib/leptris/version.rb
CHANGED
data/lib/libleptris.so
CHANGED
|
Binary file
|
data/vendor-src/README.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.9.415] - 2026-11-10
|
|
4
|
+
## Performance
|
|
5
|
+
|
|
6
|
+
- **parse: single-pass attribute-name scan** (#1842 attrparse arc, agent-implemented). `dp_parse_attrs` classified the byte after every attribute name twice — the fused name scan stopped on a non-name-char with its chartype already in a register, then a second fused-classification call re-loaded and re-tested the same byte. The scan now captures the stop byte's full class (`DP_CT_NAME_CHAR` mirrors IS_NAME_CHAR's bits) and the `=` dispatch consumes it directly; whitespace continues inline; all error paths, hash order, colon tracking, and NUL discipline byte-identical. User-CPU on the attribute-dense attrparse workload: **−4.2% quiet / −1.8% interleaved-under-load**. Suite 2250/2250; two negative results from the same slice documented in the commit (a noise-level dup-probe skip, and a `need_dup_hash` loop-hoist that *regressed* 17% under LTO — reverted).
|
|
7
|
+
|
|
8
|
+
## Benchmarks
|
|
9
|
+
|
|
10
|
+
- The attrparse comparison rows (v1.9.414) already use the corrected parse+read methodology; this release narrows the remaining gap to pugixml on that shape by ~4%.
|
|
11
|
+
|
|
12
|
+
## [1.9.414] - 2026-11-08
|
|
13
|
+
## Performance
|
|
14
|
+
|
|
15
|
+
- **parse: the pool string_cache is lazy** (#1842 A4). direct_parse created a 128-bucket hash table eagerly for every >=256-byte document, but the scanner stores borrowed views and most documents never intern anything through that path — the eager create cost ~70 ns/doc (5.6% of the parse on the attribute-dense attrparse shape, line-level profiled). The intern path now creates the table on first use; the OOM path falls back to direct allocation exactly as before. Users-doc parse +2%, attribute-dense shape +1%, one 128-bucket pool block saved per document.
|
|
16
|
+
|
|
17
|
+
## Benchmarks
|
|
18
|
+
|
|
19
|
+
- **The attrparse comparison rows are honest now.** They measured parse-WITHOUT-tree-access: pugixml's `load_buffer` parses eagerly while leptris defers until first tree access, so the old rows compared handle-setup against parsing (apples to oranges) under loaded-machine wall timing. The rows now measure parse + walk + read every attribute name and value on BOTH engines with a min-of-5-reps statistic — on this machine leptris ~1600 ns/doc vs pugixml ~1420, and the CPU-clock head-to-head with the tree walk shows parity (the previously reported 2.0x deficit was the methodology artifact; full post-mortem on #1842).
|
|
20
|
+
|
|
3
21
|
## [1.9.413] - 2026-11-08
|
|
4
22
|
## Performance
|
|
5
23
|
|
|
@@ -1060,11 +1060,11 @@ attribute uniqueness rule.
|
|
|
1060
1060
|
|Benchmark |Leptris |pugixml |Advantage
|
|
1061
1061
|
|
|
1062
1062
|
|Append 10000 children (one parent)
|
|
1063
|
-
|
|
|
1064
|
-
|
|
|
1065
|
-
|
|
1066
|
-
index bookkeeping
|
|
1067
|
-
|
|
1063
|
+
|22.7 ns/child
|
|
1064
|
+
|36.0 ns/child
|
|
1065
|
+
|**1.6× faster** (fresh `bench_append_attr_pugixml` run; the
|
|
1066
|
+
doc-level index bookkeeping cost noted in earlier revisions was
|
|
1067
|
+
removed by the lane-18 append/attr work)
|
|
1068
1068
|
|
|
1069
1069
|
|Set 2000 attributes (duplicate-rejecting)
|
|
1070
1070
|
|347 µs
|
|
@@ -1082,6 +1082,50 @@ set_attribute at scale)
|
|
|
1082
1082
|
|1.1× slower (measured; the two are at parity within run noise)
|
|
1083
1083
|
|===
|
|
1084
1084
|
|
|
1085
|
+
==== Attribute-dense parse+read (vs pugixml) — 2026-11 refresh
|
|
1086
|
+
|
|
1087
|
+
Numbers from `bench_append_attr_pugixml` (the `attrparse` rows),
|
|
1088
|
+
methodology corrected in v1.9.414: the workload is parse + walk +
|
|
1089
|
+
read every attribute name and value on BOTH engines (the previous
|
|
1090
|
+
revision measured parse-without-access, which compared leptris's
|
|
1091
|
+
deferred-until-touch handle against pugixml's eager parse), taking
|
|
1092
|
+
the MIN of 5 repetitions.
|
|
1093
|
+
|
|
1094
|
+
[cols="2,>1,>1,>1",options="header"]
|
|
1095
|
+
|===
|
|
1096
|
+
|Benchmark |Leptris |pugixml |Verdict
|
|
1097
|
+
|
|
1098
|
+
|Parse+read 64-attr doc (default flags)
|
|
1099
|
+
|~1.6 µs
|
|
1100
|
+
|~1.4 µs
|
|
1101
|
+
|parity (1.15x; user-CPU equal at 4M docs)
|
|
1102
|
+
|
|
1103
|
+
|Parse+read (Door A: skip dup + positions)
|
|
1104
|
+
|~1.55 µs
|
|
1105
|
+
|~1.4 µs
|
|
1106
|
+
|parity
|
|
1107
|
+
|
|
1108
|
+
|Full-window CPU-clock head-to-head (4M docs)
|
|
1109
|
+
|5.45 s user
|
|
1110
|
+
|5.45 s user
|
|
1111
|
+
|**equal — user-CPU parity**
|
|
1112
|
+
|===
|
|
1113
|
+
|
|
1114
|
+
==== Recent performance wins (v1.9.410-v1.9.414)
|
|
1115
|
+
|
|
1116
|
+
Each release-verified via ABBA with fresh RelWithDebInfo+LTO builds:
|
|
1117
|
+
|
|
1118
|
+
* **+29%** HTML parse (#1218 arena-span + tag-id slices)
|
|
1119
|
+
* **+6.4%** XPath scoreboard row — `//a | //b` unions fuse to one
|
|
1120
|
+
doc-ordered pass (v1.9.412)
|
|
1121
|
+
* **+3.5%** parse — loop-invariant parser fields hoisted to const
|
|
1122
|
+
locals (v1.9.413)
|
|
1123
|
+
* **+1-2%** parse — the pool string_cache created lazily on first
|
|
1124
|
+
intern instead of eagerly per document (v1.9.414)
|
|
1125
|
+
* **1.011x / 1.018x** — node-test hash pre-filter, fused
|
|
1126
|
+
name-scan+hash-split (v1.9.411-412)
|
|
1127
|
+
|
|
1128
|
+
|
|
1085
1129
|
See also `benchmarks/README.md` for the decomposition benchmark
|
|
1086
1130
|
(`benchmark_decomp`: isolates text/element/attr/text-node costs)
|
|
1087
1131
|
and the SAX benchmark (`benchmark_sax`: leptris vs libxml2 SAX2 —
|
|
@@ -15,6 +15,8 @@ static double now_ns() {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
int main(void) {
|
|
18
|
+
volatile size_t sink = 0;
|
|
19
|
+
(void)sink;
|
|
18
20
|
const int N_APPEND = 200000;
|
|
19
21
|
const int N_PARSE = 20000;
|
|
20
22
|
|
|
@@ -106,46 +108,104 @@ int main(void) {
|
|
|
106
108
|
xml += "/>";
|
|
107
109
|
}
|
|
108
110
|
xml += "</r>";
|
|
111
|
+
/* #1842 attr-parse methodology (corrected 2026-11-09): the old
|
|
112
|
+
* rows measured parse-without-access — apples to oranges, since
|
|
113
|
+
* pugixml's load_buffer parses EAGERLY while leptris defers
|
|
114
|
+
* until first tree access (the no-access loop completed at
|
|
115
|
+
* handle-setup cost and the row compared setup vs parse). The
|
|
116
|
+
* honest workload: parse + walk + read every attribute name and
|
|
117
|
+
* value on BOTH engines. Statistic: MIN of 5 repetitions — the
|
|
118
|
+
* standard noise-robust estimator for microbenchmarks (max
|
|
119
|
+
* responsiveness, min scheduler noise). */
|
|
109
120
|
{
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
121
|
+
const int REPS = 5;
|
|
122
|
+
double best_lx = 1e18, best_lx_a = 1e18, best_pugi = 1e18;
|
|
123
|
+
for (int rep = 0; rep < REPS; rep++) {
|
|
124
|
+
{
|
|
125
|
+
double t0 = now_ns();
|
|
126
|
+
for (int i = 0; i < N_PARSE; i++) {
|
|
127
|
+
LeptrisDocument d = leptris_parse_string(
|
|
128
|
+
xml.data(), xml.size(), NULL);
|
|
129
|
+
if (!d) return 4;
|
|
130
|
+
LeptrisElement r = leptris_document_root(d);
|
|
131
|
+
if (!r) return 5;
|
|
132
|
+
for (LeptrisElement c =
|
|
133
|
+
leptris_element_first_child_any(r);
|
|
134
|
+
c;
|
|
135
|
+
c = leptris_element_next_sibling_any(c)) {
|
|
136
|
+
const char* names[32]; const char* vals[32];
|
|
137
|
+
size_t na = leptris_element_attributes_raw(
|
|
138
|
+
c, names, vals, 32);
|
|
139
|
+
for (size_t k = 0; k < na; k++) {
|
|
140
|
+
sink += strlen(names[k]);
|
|
141
|
+
sink += strlen(vals[k]);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
leptris_document_free(d);
|
|
145
|
+
}
|
|
146
|
+
double t1 = now_ns();
|
|
147
|
+
double ns = (t1 - t0) / N_PARSE;
|
|
148
|
+
if (ns < best_lx) best_lx = ns;
|
|
149
|
+
}
|
|
150
|
+
{
|
|
151
|
+
/* Door A (leptris#1436, shipped v1.9.272): the opt-in
|
|
152
|
+
* fast path — duplicate detection and source positions
|
|
153
|
+
* off. Full conformance work pugixml does none of. */
|
|
154
|
+
LeptrisParseFlags flags = static_cast<LeptrisParseFlags>(
|
|
155
|
+
LEPTRIS_PARSE_SKIP_DUP_DETECTION |
|
|
156
|
+
LEPTRIS_PARSE_SKIP_SOURCE_POSITIONS);
|
|
157
|
+
double t0 = now_ns();
|
|
158
|
+
for (int i = 0; i < N_PARSE; i++) {
|
|
159
|
+
LeptrisDocument d = leptris_parse_string_flags(
|
|
160
|
+
xml.data(), xml.size(), flags, NULL);
|
|
161
|
+
if (!d) return 6;
|
|
162
|
+
LeptrisElement r = leptris_document_root(d);
|
|
163
|
+
if (!r) return 7;
|
|
164
|
+
for (LeptrisElement c =
|
|
165
|
+
leptris_element_first_child_any(r);
|
|
166
|
+
c;
|
|
167
|
+
c = leptris_element_next_sibling_any(c)) {
|
|
168
|
+
const char* names[32]; const char* vals[32];
|
|
169
|
+
size_t na = leptris_element_attributes_raw(
|
|
170
|
+
c, names, vals, 32);
|
|
171
|
+
for (size_t k = 0; k < na; k++) {
|
|
172
|
+
sink += strlen(names[k]);
|
|
173
|
+
sink += strlen(vals[k]);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
leptris_document_free(d);
|
|
177
|
+
}
|
|
178
|
+
double t1 = now_ns();
|
|
179
|
+
double ns = (t1 - t0) / N_PARSE;
|
|
180
|
+
if (ns < best_lx_a) best_lx_a = ns;
|
|
181
|
+
}
|
|
182
|
+
{
|
|
183
|
+
double t0 = now_ns();
|
|
184
|
+
for (int i = 0; i < N_PARSE; i++) {
|
|
185
|
+
pugi::xml_document d;
|
|
186
|
+
pugi::xml_parse_result res =
|
|
187
|
+
d.load_buffer((void*)xml.data(), xml.size());
|
|
188
|
+
if (!res) return 8;
|
|
189
|
+
for (pugi::xml_node c = d.first_child().first_child();
|
|
190
|
+
c; c = c.next_sibling()) {
|
|
191
|
+
for (pugi::xml_attribute a = c.first_attribute();
|
|
192
|
+
a; a = a.next_attribute()) {
|
|
193
|
+
sink += strlen(a.name());
|
|
194
|
+
sink += strlen(a.value());
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
double t1 = now_ns();
|
|
199
|
+
double ns = (t1 - t0) / N_PARSE;
|
|
200
|
+
if (ns < best_pugi) best_pugi = ns;
|
|
201
|
+
}
|
|
145
202
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
203
|
+
printf("attrparse leptris: %7.1f ns/doc (%zu bytes, min of %d)\n",
|
|
204
|
+
best_lx, xml.size(), REPS);
|
|
205
|
+
printf("attrparse leptris+flags: %7.1f ns/doc (Door A, min of %d)\n",
|
|
206
|
+
best_lx_a, REPS);
|
|
207
|
+
printf("attrparse pugixml: %7.1f ns/doc (min of %d)\n",
|
|
208
|
+
best_pugi, REPS);
|
|
149
209
|
}
|
|
150
210
|
return 0;
|
|
151
211
|
}
|
|
@@ -317,6 +317,12 @@ static LEPTRIS_ALWAYS_INLINE unsigned dp_class_after_ws(DParser* p) {
|
|
|
317
317
|
#else
|
|
318
318
|
# define DP_UNLIKELY(x) (x)
|
|
319
319
|
#endif
|
|
320
|
+
/* The name-char mask IS_NAME_CHAR tests, spelled out so the fused
|
|
321
|
+
* attr-name scan can keep the stop byte's FULL chartype class in a
|
|
322
|
+
* register (the delimiter byte after the name is whitespace or '=';
|
|
323
|
+
* its class is already in hand from the scan's table load — a
|
|
324
|
+
* dp_class_after_ws re-load of the same byte is pure overhead). */
|
|
325
|
+
#define DP_CT_NAME_CHAR (CT_NAME | CT_NAME_START | CT_UTF8)
|
|
320
326
|
/* Round 6: value-scan stop tables. One table load + one test per
|
|
321
327
|
* byte replaces the three-compare chain - pugixml's ct_parse_attr
|
|
322
328
|
* loop shape. 0 = boring, 1 = this value's quote, 2 = '&', 3 = ws.
|
|
@@ -1097,27 +1103,33 @@ static int dp_parse_attrs(DParser* p, LeptrisElement elem) {
|
|
|
1097
1103
|
const char* attr_colon =
|
|
1098
1104
|
(name_start[0] == ':') ? name_start : NULL;
|
|
1099
1105
|
p->pos++;
|
|
1106
|
+
/* Class of the byte that ended the name — captured from the
|
|
1107
|
+
* scan's own table loads (single-pass scan: the byte after
|
|
1108
|
+
* the name IS the delimiter, whitespace or '='). */
|
|
1109
|
+
unsigned delim;
|
|
1100
1110
|
{
|
|
1101
1111
|
char* s = p->pos;
|
|
1112
|
+
unsigned k = leptris_chartype_table[(unsigned char)s[0]];
|
|
1102
1113
|
for (;;) {
|
|
1103
|
-
|
|
1104
|
-
if (
|
|
1105
|
-
if (
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
if (
|
|
1109
|
-
if (
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
if (
|
|
1113
|
-
if (
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
if (
|
|
1117
|
-
if (
|
|
1118
|
-
if (c3 == ':') attr_colon = s + 3;
|
|
1114
|
+
if (DP_UNLIKELY(!(k & DP_CT_NAME_CHAR))) break;
|
|
1115
|
+
if (need_dup_hash) { dh ^= (unsigned char)s[0]; dh *= 16777619u; }
|
|
1116
|
+
if (s[0] == ':') attr_colon = s;
|
|
1117
|
+
unsigned k1 = leptris_chartype_table[(unsigned char)s[1]];
|
|
1118
|
+
if (DP_UNLIKELY(!(k1 & DP_CT_NAME_CHAR))) { s += 1; k = k1; break; }
|
|
1119
|
+
if (need_dup_hash) { dh ^= (unsigned char)s[1]; dh *= 16777619u; }
|
|
1120
|
+
if (s[1] == ':') attr_colon = s + 1;
|
|
1121
|
+
unsigned k2 = leptris_chartype_table[(unsigned char)s[2]];
|
|
1122
|
+
if (DP_UNLIKELY(!(k2 & DP_CT_NAME_CHAR))) { s += 2; k = k2; break; }
|
|
1123
|
+
if (need_dup_hash) { dh ^= (unsigned char)s[2]; dh *= 16777619u; }
|
|
1124
|
+
if (s[2] == ':') attr_colon = s + 2;
|
|
1125
|
+
unsigned k3 = leptris_chartype_table[(unsigned char)s[3]];
|
|
1126
|
+
if (DP_UNLIKELY(!(k3 & DP_CT_NAME_CHAR))) { s += 3; k = k3; break; }
|
|
1127
|
+
if (need_dup_hash) { dh ^= (unsigned char)s[3]; dh *= 16777619u; }
|
|
1128
|
+
if (s[3] == ':') attr_colon = s + 3;
|
|
1119
1129
|
s += 4;
|
|
1130
|
+
k = leptris_chartype_table[(unsigned char)s[0]];
|
|
1120
1131
|
}
|
|
1132
|
+
delim = k;
|
|
1121
1133
|
p->pos = s;
|
|
1122
1134
|
}
|
|
1123
1135
|
char* name_end = p->pos;
|
|
@@ -1126,10 +1138,19 @@ static int dp_parse_attrs(DParser* p, LeptrisElement elem) {
|
|
|
1126
1138
|
/* Defer NUL-termination until after '=' is consumed — the
|
|
1127
1139
|
* delimiter byte (whitespace or '=') is needed for the scan. */
|
|
1128
1140
|
|
|
1129
|
-
/*
|
|
1130
|
-
*
|
|
1131
|
-
*
|
|
1132
|
-
|
|
1141
|
+
/* '=' must follow (possibly after whitespace). The stop byte's
|
|
1142
|
+
* class came out of the name scan — whitespace continues the
|
|
1143
|
+
* skip inline, '=' terminates the dispatch here; the former
|
|
1144
|
+
* dp_class_after_ws call re-loaded and re-tested the same byte
|
|
1145
|
+
* every attribute. NUL sentinel fails CT_ATTR_EQ exactly as
|
|
1146
|
+
* before. */
|
|
1147
|
+
if (delim & CT_WS) {
|
|
1148
|
+
p->pos = name_end + 1;
|
|
1149
|
+
while (leptris_chartype_table[(unsigned char)*p->pos] & CT_WS)
|
|
1150
|
+
p->pos++;
|
|
1151
|
+
delim = leptris_chartype_table[(unsigned char)*p->pos];
|
|
1152
|
+
}
|
|
1153
|
+
if (!(delim & CT_ATTR_EQ)) return -1;
|
|
1133
1154
|
p->pos++;
|
|
1134
1155
|
/* '=' consumed — the delimiter byte at name_end is no longer
|
|
1135
1156
|
* needed. Safe to NUL-terminate the name in-place now. */
|
|
@@ -1568,10 +1589,6 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
|
|
|
1568
1589
|
leptris_arena_destroy(arena);
|
|
1569
1590
|
return NULL;
|
|
1570
1591
|
}
|
|
1571
|
-
if (len >= 256) {
|
|
1572
|
-
pool->string_cache = leptris_hash_table_create(pool, 128);
|
|
1573
|
-
}
|
|
1574
|
-
|
|
1575
1592
|
/* Round 8 carve: scratch first, then the pristine copy for
|
|
1576
1593
|
* const inputs — the first pool bumps, so the scanner's buffers
|
|
1577
1594
|
* sit at the front of the document-owned span. doc_free skips
|
|
@@ -780,13 +780,23 @@ char* leptris_pool_intern_string(LeptrisMemoryPool* pool, const LeptrisStringVie
|
|
|
780
780
|
return NULL;
|
|
781
781
|
}
|
|
782
782
|
|
|
783
|
-
/*
|
|
783
|
+
/* The table is created LAZILY on the first intern (#1842 A4):
|
|
784
|
+
* direct_parse created a 128-bucket table eagerly for every
|
|
785
|
+
* >=256-byte document, but the scanner stores borrowed views and
|
|
786
|
+
* most documents never intern anything through this path — the
|
|
787
|
+
* eager create cost ~70 ns/doc on the attrparse shape (5.6% of
|
|
788
|
+
* the parse, line-level profiled). Callers that intern pay the
|
|
789
|
+
* create once, on first use. */
|
|
784
790
|
if (!pool->string_cache) {
|
|
785
|
-
|
|
786
|
-
if (!
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
791
|
+
pool->string_cache = leptris_hash_table_create(pool, 128);
|
|
792
|
+
if (!pool->string_cache) {
|
|
793
|
+
/* cold-path OOM: fall back to direct allocation */
|
|
794
|
+
char* str = (char*)leptris_pool_alloc(pool, sv->length + 1);
|
|
795
|
+
if (!str) return NULL;
|
|
796
|
+
memcpy(str, sv->data, sv->length);
|
|
797
|
+
str[sv->length] = '\0';
|
|
798
|
+
return str;
|
|
799
|
+
}
|
|
790
800
|
}
|
|
791
801
|
|
|
792
802
|
StringHashTable* table = pool->string_cache;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
|
|
3
3
|
"name": "leptris",
|
|
4
|
-
"version": "1.9.
|
|
4
|
+
"version": "1.9.415",
|
|
5
5
|
"description": "High-performance XML parser and XPath 1.0 engine in C (libleptris)",
|
|
6
6
|
"homepage": "https://github.com/leptris/leptris",
|
|
7
7
|
"license": "MIT",
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: leptris
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.9.
|
|
4
|
+
version: 1.9.415.0
|
|
5
5
|
platform: arm-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ffi
|