Vibescript 0.70 improves string processing, JSON, static checking, and repeated script calls while reducing temporary allocations and retained memory. Optimized paths keep their work, memory, and cancellation checks, and this release also closes accounting and module-policy gaps found during the performance audit.
Ordinary release binaries continue to target Go 1.26. Source builds can opt into Go 1.27.1 SIMD on ARM64 and AVX2-capable x86-64, with portable fallbacks for unsupported CPUs and short inputs. See building instructions.
Go module users already on a v1.0.0-rc release must select this version explicitly because v0.70.0 has lower semantic-version precedence: go get github.com/mgomes/vibescript@v0.70.0.
Performance and memory highlights
- Speed up ASCII length, index, reverse index, slicing, case conversion, and case comparison through shared word scans and optional SIMD kernels.
- Scan literal spans in regular-expression quoting, JSON, formatting, and string compilation, and batch long whitespace runs in split and trim operations.
- Avoid redundant Unicode rune scans in
rindex, including calls that omit an offset, while preserving bounded and negative offsets and malformed UTF-8. - Stream block
String#scanmatches so early returns avoid collecting the remaining matches. - Reuse stable memory estimates during
uniqand keep unrelated writes from invalidating cached estimates of unchanged values. - Avoid cloning unused declarations on each script call and keep static checking of independent declarations linear. Reuse union-type classifications.
- Release discarded JSON documents, regex subjects and cached pattern storage, deleted hash keys, and values in returned function, receiver, and rescue scopes.
- Reduce short-call execution state, reuse bounded scratch space for JSON and outbound host cloning, and skip unused compiler directive maps.
Representative before/after measurements for individual changes on Apple M4, Go 1.26.3 (these are not a cumulative comparison against v0.60.0):
| Workload | Before | After |
|---|---|---|
200 Unicode rindex calls |
1,198.2 µs | 640.1 µs |
Short Script.Call, allocated bytes |
3,472 B/op | 3,216 B/op |
| 80 JSON stringify calls, allocated bytes | 53,562 B/op | 38,201 B/op |
| Compile 251 functions, allocated bytes | 248,888 B/op | 222,032 B/op |
See the rune-scan investigation, execution measurements, allocation measurements, and retention measurements for workloads, platform results, and tradeoffs. Detached JSON tokens and partial regex matches pay a copying cost to release source buffers; calls deeper than four frames need an extra allocation. Some unchanged string controls still vary with executable layout, so the measurements do not imply that every workload becomes faster.
The release also bounds parser and rendering depth, regex and JSON work, collection projections, and capability copying; meters accounting walks; and enforces module policy before filesystem access.