[pull] master from GaijinEntertainment:master#969
Merged
Conversation
…fold benchctl - replace hand-rolled flags.das with daslib/clargs (single struct, positional command + files, structured filters) - replace raw sqlite3_* calls in bench_sql.das with [sql_table] Benchmark + with_sqlite + db |> insert(rows) bulk + _sql(... |> select_from |> _where(...)) for query and compare paths - structured filter flags (--commit / --tag / --old-commit / --old-tag / --new-commit / --new-tag) replace user-supplied --select raw-WHERE; flag composition uses _sql || empty-string short-circuit so one call site covers all flag combinations - isolate clargs in bench_args.das (private require) to work around an Option<string> ambiguity bug when daslib/clargs and sqlite/sqlite_boost are in the same module (filed as #2598) - delete bench_sql.das, flags.das; add bench_args.das, bench_table.das - README rewritten for the structured-flag surface benchmarks/sql/ - new comparison suite mirroring tests/dasSQLITE/parity_check_*.das shape but oriented to throughput: _common.das fixture + select_where.das, select_where_order_take.das, count_aggregate.das - 6 modes per file: m1m / m1d (_sql, mem/disk), m2m / m2d (no _sql, select_from materializes, mem/disk), m3 (array LINQ), m3f (_fold fused array LINQ); disk DBs created+deleted outside timed block - benchmarks/README.md adds the sql/ section daslib/linq_boost - new fold_where_count + ["where_", "count"] FoldSequence: emits a single-pass invoke($(source) { var n; for it in source; if pred(it) n++; return n }, top) with the predicate spliced via fold_linq_cond - eliminates intermediate filter array AND block-call overhead - count_aggregate m3f: 25.5 -> 8 ns/op (INTERP), 3 ns/op (JIT); zero alloc; ~5x faster than _sql at 10K rows in memory Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot review on PR #2599: - run_reset_cmd now uses try_drop_table_if_exists / try_create_table and returns an error string; the implicit-init path propagates it instead of crashing on a corrupt or locked DB. - run_query_cmd rejects multiple --tag values for query (previously silently used only the first); compare-side scalar flags unchanged. - Insert tag loop skips empty tags and rejects '[' / ']' in tag values (the bracket scheme cannot delimit them safely). - README annotates --tag as single-value for query, bracket-free for insert. benchmarks/sql/ simplification (per Boris): drop the m1d / m2m / m2d modes (disk vs memory was a one-shot finding; no-_sql DB modes only re-prove that select_from materializes -- already documented). Each file now compares 3 modes: m1 (_sql over :memory:), m3 (plain array LINQ), m3f (_fold-fused array LINQ). Removed disk_db_setup / cleanup helpers from _common.das; updated benchmarks/README.md mode matrix. count_aggregate bumped to 1M; per-element cost is flat from 100k -> 1M across all three modes (m1 38, m3 12, m3f 3 ns/op). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nt fold test Copilot review round 2 on PR #2599: - run_subcommand validates `cmd` against {reset, insert, query, compare} before opening the SQLite DB. Typos (e.g. `qurey`) no longer create an empty benchdata.db as a side effect. - Extracted validate_tag_chars helper; insert/query/compare all reject '[' or ']' in tag values consistently (previously only insert did). - run_compare_cmd restores the overlap-exclusion semantic the old code had: collects --old result IDs into a table<int;bool> and post-filters --new entries against it. Identical/empty filters on both sides can no longer compare a result set against itself. Implemented in daslang (no raw-SQL escape hatch). - benchmarks/README.md table previously claimed `count_aggregate` ran at 100K; updated to 1M to match the shipped benchmark constant. Two adds: - benchmarks/sql/indexed_lookup.das — point-lookup benchmark (`_where(_.id == K)` against PRIMARY KEY) at 1M rows. Inverse-asymmetry pair to count_aggregate: SQLite's b-tree wins by ~1000x (m1 ~3 us, m3 ~9 ms, m3f ~3.4 ms per lookup at JIT). Documents where indexed storage earns its keep. - tests/linq/test_linq_fold.das — regression test for the where+count fold rule added in fcb6481. Covers half-match, zero-match, all-match, and empty-source cases. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
benchctl: clargs + sqlite_linq rewrite, sql/ benchmarks, where+count fold
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )