Re: Wondering what I'm doing wrong?

"David McClain (as dbm at refined-audiometrics dot com)" <[email protected]> Thu, 11 Jun 2026 17:18:09 -0700
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
I converted my CL-PPCRE parsers into ESRAP, and I also found a slightly more modern PEG parser PARSEQ. I find both ESRAP and Parseq to be much easier to code for this task. And Parseq even a bit more convenient than ESRAP.

I won’t bore you with the code trees, but here is a direct comparison of their behavior on a fairly complex number parsing task for inhaling a Timestamp:

The timing test code:

(time
 (dotimes (ix 100_000)
   (read-extended-numbers "2026/10/12T12:23:32.3U-7")))

The Results:

CL-PPCRE
;; About 84s for 10^5 iters, so 840μs/iter
;; Allocation   = 38,992,235,512 bytes, or 389,922 bytes/iter
;; 2292 Page faults

ESRAP (PEG Packrat?)
;; About 68s for 10^5 iters, so 680μs/iter
;; Allocation   = 34,755,853,968 bytes, or 347,558 bytes/iter
;; 5181 Page faults

Parseq (PEG Non-Packrat)
;; About 19s for 10^5 iters, so 190μs/iter
;; Allocation   = 9,121,975,192 bytes, or 91,219 bytes/iter
;; 209 Page faults

FWIW…