leptris 1.9.414.0-aarch64-linux → 1.9.415.0-aarch64-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c7b8ebdea1ff210305a8a97b15ac279bc307b7c1ed68fe651e90fa1b9fbb5b0
4
- data.tar.gz: f476ab25fcb358578327caead84dc673d262c4beafb39f9178478fe86976e266
3
+ metadata.gz: 643a3ccc15071884acf65ab2cd2a0f25e510d3515485a854046875e8be909556
4
+ data.tar.gz: c18482d2627eda5ba40e9c8a5c11923b5d0ce2b3c1db7dd3f5de88c5592eeddd
5
5
  SHA512:
6
- metadata.gz: 5f3e20b48eb25996b3aa6b4d52cb16cf420e407214b88299b70a6be7abefd522ac5ec2ac8ae068949391b65d40d9de8b8c2694a53c0b56e3cf73d82e0f15bd2a
7
- data.tar.gz: fd3faa51db9459b45186a3974f74b1484f05b04ad653f89e6da149ff75b7f9648a45a4cf48682f97a69db1ddb98b54d5432c104fe62322a31912c1e6e7c2c6fc
6
+ metadata.gz: c0368767bce157e9d83da315732e5c0daade5f2b19a4b7707e6e6f47021934e764d46b9efb29b15f12059d89fbe761f211ea5d71d231eeb3e7882eddf51b49ba
7
+ data.tar.gz: 5559d9cb36c974107c31c505674c194c82afae622455349c92ac93079297f54c9db82dc4ee57bf69b0b0f91fce0d40d0d21079e4487b7f450516bba06e26461f
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.414"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.414.0"
4
+ VERSION = "1.9.415.0"
5
5
  end
data/lib/libleptris.so CHANGED
Binary file
data/vendor-src/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Sources vendored in this gem (recompile rights; the ruby
2
2
  variant builds them at install via extconf.rb):
3
3
 
4
- - libleptris v1.9.414
4
+ - libleptris v1.9.415
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,14 @@
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
+
3
12
  ## [1.9.414] - 2026-11-08
4
13
  ## Performance
5
14
 
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.414
6
+ VERSION 1.9.415
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -1060,11 +1060,11 @@ attribute uniqueness rule.
1060
1060
  |Benchmark |Leptris |pugixml |Advantage
1061
1061
 
1062
1062
  |Append 10000 children (one parent)
1063
- |160 µs
1064
- |119 µs
1065
- |1.3× slower (measured; was 2.5× faster pre-attr-index — the doc-level
1066
- index bookkeeping is the cost of O(1) duplicate-rejecting
1067
- set_attribute at scale)
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 —
@@ -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
- char c0 = s[0];
1104
- if (DP_UNLIKELY(!IS_NAME_CHAR(c0))) break;
1105
- if (need_dup_hash) { dh ^= (unsigned char)c0; dh *= 16777619u; }
1106
- if (c0 == ':') attr_colon = s;
1107
- char c1 = s[1];
1108
- if (DP_UNLIKELY(!IS_NAME_CHAR(c1))) { s += 1; break; }
1109
- if (need_dup_hash) { dh ^= (unsigned char)c1; dh *= 16777619u; }
1110
- if (c1 == ':') attr_colon = s + 1;
1111
- char c2 = s[2];
1112
- if (DP_UNLIKELY(!IS_NAME_CHAR(c2))) { s += 2; break; }
1113
- if (need_dup_hash) { dh ^= (unsigned char)c2; dh *= 16777619u; }
1114
- if (c2 == ':') attr_colon = s + 2;
1115
- char c3 = s[3];
1116
- if (DP_UNLIKELY(!IS_NAME_CHAR(c3))) { s += 3; break; }
1117
- if (need_dup_hash) { dh ^= (unsigned char)c3; dh *= 16777619u; }
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
- /* Skip = and whitespace — the fused class test again: the
1130
- * stop byte after the name's trailing ws must be '='. NUL
1131
- * sentinel fails CT_ATTR_EQ. */
1132
- if (!(dp_class_after_ws(p) & CT_ATTR_EQ)) return -1;
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. */
@@ -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.414",
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.414.0
4
+ version: 1.9.415.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-08 00:00:00.000000000 Z
11
+ date: 2026-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi