Commit 4e825eeb

4e825eeb7a7cMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 7 months ago · 1 file · ~1 modified

Description

docs: note recent codegen improvements and warning-free build

Add three bullets to the Optimizations section:

  • iterative inference early exit (~14% bootstrap speedup)
  • parse_id_list byte-walk path (avoids split allocations)
  • warning-free build policy enforced via -Werror in test/bench

Also refresh the line-count column in the Architecture table (spinel_codegen.rb has grown from 20,851 to 21,109, lib/regexp totals 1,759 now).

Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]

Details

Commit
4e825eeb7a7c
Parent
c1bb79ebe898

README.mdmodifiedView file

@@ -227,16 +227,27 @@
227227 - **Dead-code elimination**: compiled with `-ffunction-sections
228228 -fdata-sections` and linked with `--gc-sections`; each unused
229229 runtime function is stripped from the final binary.
230+- **Iterative inference early exit**: the param/return/ivar fixed-point
231+ loop stops as soon as a signature of the three refined arrays stops
232+ changing. Most programs converge in 1-2 iterations instead of the
233+ full 4, cutting bootstrap time by ~14%.
234+- **`parse_id_list` byte walk**: the AST-field list parser (called
235+ ~120 K times during self-compile) walks bytes manually via
236+ `s.bytes[i]` instead of `s.split(",")`, dropping N+1 allocations
237+ per call to 2.
238+- **Warning-free build**: generated C compiles cleanly at the default
239+ warning level across every test and benchmark; the harness uses
240+ `-Werror` so regressions surface immediately.
230241
231242 ## Architecture
232243
233244 ```
234245 spinel One-command wrapper script (POSIX shell)
235246 spinel_parse.c C frontend: libprism → text AST (1,061 lines)
236-spinel_codegen.rb Compiler backend: AST → C code (20,851 lines)
247+spinel_codegen.rb Compiler backend: AST → C code (21,109 lines)
237248 lib/sp_runtime.h Runtime library header (581 lines)
238249 lib/sp_bigint.c Arbitrary precision integers (5,394 lines)
239-lib/regexp/ Built-in regexp engine (1,626 lines)
250+lib/regexp/ Built-in regexp engine (1,759 lines)
240251 test/ 74 feature tests
241252 benchmark/ 55 benchmarks
242253 Makefile Build automation