~/talk

Improvement of REXML and speed up using StringScanner

Talkat RubyKaigi 2025 · 2025-04-16..04-18· [ruby]
links:none on file
slides:none on file

REXML gets concrete speedups by replacing regex-heavy parsing with Ruby's StringScanner and byte-level reads: benchmarks show REXML 3.4.1 = up to 60% faster compared to 3.2.6, YJIT adds further gains, and microbenchmarks show StringScanner gives 1.8x to 3.6x speedups (55% faster for scan-regex vs regex check; scanUntil up to ~3.6x on long CDATA). Changes also reduce temporary string allocations by using peek_byte and match-based checks, and the improved parser is stable in benchmarks.

AI-written summary · about

  1. 0:00Introduction and background
  2. 5:03What is REXML and XML
  3. 9:04Motivation for speed improvement
  4. 10:11StringScanner basics
  5. 13:56Replacing regex with StringScanner
  6. 20:00Performance benefits of StringScanner
  7. 23:42Optimization techniques in Ruby 3.1.2
  8. 28:21Q&A and summary
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.