leptris 1.9.311.2 → 1.9.311.3

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: 9b6ce086c202566aa39cb833bb1033abd8f734c187fced742f7fb5f0f35bbadb
4
- data.tar.gz: 3ef07e258734ab68cb1468be51c990bd882290dd7708aaf6b868bb065c67bad1
3
+ metadata.gz: a004384f7927ff6e71fd0277c1920ca6890a69c9dee52f36f267c85807cf8b0b
4
+ data.tar.gz: a02220a1a36d2016d947f35065d204a92811fc99559b8e5d596f0c5278d4089a
5
5
  SHA512:
6
- metadata.gz: 0af5534cc38131cec871844ad89d1f57c387e7257a5e3bd4aa688fe77e3f2e10521a8a3f0461d01b27b098c0f4b55e2c81ecfd7a232380b9392032caaa6d4197
7
- data.tar.gz: c6f47da5b6332b3b518a98afc1856a449d1443a72cb96a0eb02adb8deac348f4b79467f0300ab5171f5d9a25727da217e1a22e7b05c89476a9ec92cce689a2a8
6
+ metadata.gz: 7f599ca78c88649f4778c81644947dc939fcbfe2db06179f4b7785d62bb46ce3ea4fc86ccf6b589d5f83b06ea1ab3e0686a1427fba31ad27ca7b67c39b6993a2
7
+ data.tar.gz: d1030e40b0903052901e5a245b17531f44ad7ee718daefc303644e7bebc630debea0594bd930273fdcaabe0c9745951263965706e54fdf5ffb583f2bc58bd4e1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## [1.9.311.3] - 2026-10-06
2
+
3
+ ### Performance
4
+
5
+ - **Same-document splices stop paying the cross-document sweep
6
+ (#374, the fresh-doc 0.80x follow-up)**: every fast splice path
7
+ is reached only after `foreign_to?` said no — the child's
8
+ document IS this one — so the post-splice
9
+ `invalidate_cross_document!` (a method call plus two ivar reads
10
+ that always returned at the equal check) was dead weight on the
11
+ hottest construction loop. Removed from the add_child /
12
+ prepend_child / sibling-insert fast paths and their FFI tails
13
+ (the foreign and batch paths keep their sweeps); `add_child` no
14
+ longer runs the Ruby-side readonly/version gate twice when the
15
+ C face self-gates. Measured under load with interleaved
16
+ CPU-time medians (3 rounds, 15k appends): add_child 1.69 →
17
+ 1.41 µs/call (~16%), programmatic build ~14%.
18
+
1
19
  ## [1.9.311.2] - 2026-10-06
2
20
 
3
21
  ### Fixed
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.311.2"
4
+ VERSION = "1.9.311.3"
5
5
  end
@@ -446,7 +446,6 @@ class Leptris::XML::Element < Leptris::XML::Node
446
446
  if native_fast_children?
447
447
  unless Leptris::XML::Native.insert_binding_child(
448
448
  @document, @c_address, node.c_ptr.address, 1).nil?
449
- Leptris::XML::Node.invalidate_cross_document!(node, @document)
450
449
  return node
451
450
  end
452
451
  end
@@ -456,7 +455,6 @@ class Leptris::XML::Element < Leptris::XML::Node
456
455
  end
457
456
  Leptris::XML::FFI.check_status(
458
457
  Leptris::XML::FFI.leptris_element_prepend_child(c_ptr, node.c_ptr))
459
- Leptris::XML::Node.invalidate_cross_document!(node, @document)
460
458
  node
461
459
  end
462
460
 
@@ -481,7 +479,6 @@ class Leptris::XML::Element < Leptris::XML::Node
481
479
  if native_fast_children?
482
480
  unless Leptris::XML::Native.insert_binding_child(
483
481
  @document, @c_address, node.c_ptr.address, 2).nil?
484
- Leptris::XML::Node.invalidate_cross_document!(node, @document)
485
482
  return node
486
483
  end
487
484
  end
@@ -491,7 +488,6 @@ class Leptris::XML::Element < Leptris::XML::Node
491
488
  end
492
489
  Leptris::XML::FFI.check_status(
493
490
  Leptris::XML::FFI.leptris_element_insert_after(c_ptr, node.c_ptr))
494
- Leptris::XML::Node.invalidate_cross_document!(node, @document)
495
491
  node
496
492
  end
497
493
 
@@ -516,7 +512,6 @@ class Leptris::XML::Element < Leptris::XML::Node
516
512
  if native_fast_children?
517
513
  unless Leptris::XML::Native.insert_binding_child(
518
514
  @document, @c_address, node.c_ptr.address, 3).nil?
519
- Leptris::XML::Node.invalidate_cross_document!(node, @document)
520
515
  return node
521
516
  end
522
517
  end
@@ -526,7 +521,6 @@ class Leptris::XML::Element < Leptris::XML::Node
526
521
  end
527
522
  Leptris::XML::FFI.check_status(
528
523
  Leptris::XML::FFI.leptris_element_insert_before(c_ptr, node.c_ptr))
529
- Leptris::XML::Node.invalidate_cross_document!(node, @document)
530
524
  node
531
525
  end
532
526
 
@@ -672,7 +666,6 @@ class Leptris::XML::Element < Leptris::XML::Node
672
666
  end
673
667
 
674
668
  def add_child(node_or_markup)
675
- ensure_writable!
676
669
  case node_or_markup
677
670
  when Leptris::XML::Node
678
671
  # Foreign-child adoption (1.9.304, #1528): the engine
@@ -686,22 +679,24 @@ class Leptris::XML::Element < Leptris::XML::Node
686
679
  # readonly/liveness gates, the provable no-op lift
687
680
  # predicate, the version bump, and the engine append. Qnil
688
681
  # means the child needs the namespace lift — fall through
689
- # to the full path.
682
+ # to the full path. Same-document children cannot reach
683
+ # here from another document (foreign ones routed above),
684
+ # so there is no cross-document sweep to run (#374): the
685
+ # C-side version bump invalidates this document's memos.
690
686
  if native_fast_children?
691
687
  # The face raises on failure (TODO.perf/36); Qnil = the
692
688
  # child needs the lift — the full path handles it.
693
689
  unless Leptris::XML::Native.append_binding_child(
694
690
  @document, @c_address, node_or_markup.c_ptr.address).nil?
695
- Leptris::XML::Node.invalidate_cross_document!(node_or_markup, @document)
696
691
  return node_or_markup
697
692
  end
698
693
  end
694
+ ensure_writable!
699
695
  unless Leptris::XML::Element.skip_adoption_lift?(node_or_markup)
700
696
  Leptris::XML::Element.lift_namespaces_for_adoption(node_or_markup, namespaces)
701
697
  end
702
698
  Leptris::XML::FFI.check_status(
703
699
  Leptris::XML::FFI.leptris_element_append_child(c_ptr, node_or_markup.c_ptr))
704
- Leptris::XML::Node.invalidate_cross_document!(node_or_markup, @document)
705
700
  node_or_markup
706
701
  when String
707
702
  # TODO.perf/34: one dispatch parses the markup and appends
@@ -721,6 +716,7 @@ class Leptris::XML::Element < Leptris::XML::Node
721
716
  # path (it re-fails fast)
722
717
  Leptris::XML::DocumentFragment.parse(node_or_markup, @document)
723
718
  end
719
+ ensure_writable!
724
720
  frag = Leptris::XML::DocumentFragment.parse(node_or_markup, @document)
725
721
  added = []
726
722
  frag.children.each do |n|
@@ -741,6 +737,7 @@ class Leptris::XML::Element < Leptris::XML::Node
741
737
  # original is removed after (the source loses the node, as
742
738
  # every pre-304 caller observed).
743
739
  def append_installed(node)
740
+ ensure_writable!
744
741
  unless Leptris::XML::Element.skip_adoption_lift?(node)
745
742
  Leptris::XML::Element.lift_namespaces_for_adoption(node, namespaces)
746
743
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.311.2
4
+ version: 1.9.311.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.