Skip to content

Optimisation - #3

Merged
synesissoftware merged 5 commits into
synesissoftware:masterfrom
mwsis:opt
Jul 2, 2026
Merged

Optimisation#3
synesissoftware merged 5 commits into
synesissoftware:masterfrom
mwsis:opt

Conversation

@mwsis

@mwsis mwsis commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

mwsis added 4 commits July 2, 2026 13:34
    * modularised implementation (`constants`, `parse`, `truthy`); parsing algorithm unchanged from 0.0.4;
    * added **benchmarks/string_truthy.py** and **benchmarks/run_all_benchmarks.sh**;
    * `str2bool()` and `string_is_truthy()` now classify stock terms via `_TRUTHY_STRINGS` and a module-built `_TRUTHY_TABLE` keyed by `(length, first_char)` (cf. **to-be.Rust** first-letter dispatch); always strips before lookup; strong on padded stock terms and unrecognised inputs (benchmarked);
    * retained one-sided `string_is_falsey()` and `string_is_truey()` paths (`_str_is_falsey`, `_str_is_truey`) with opposite-precise fast-fail and conditional `strip().lower()` (cf. **to-be.Rust**); `constants.py` precise/lowercase tuples remain for these paths until a later elision pass;
    * added docstrings to `str2bool()`, `string_is_falsey()`, `string_is_truey()`, and `string_is_truthy()`;
    * measured and ruled out for stock vocabulary at current table sizes: merged precise-table linear scan, `bisect` lookup, state-machine parsers, and conditional-trim fast paths (see **README** benchmarks section);
@mwsis
mwsis requested a review from synesissoftware July 2, 2026 08:09
@mwsis mwsis self-assigned this Jul 2, 2026
@synesissoftware
synesissoftware merged commit 7a1648a into synesissoftware:master Jul 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants