Build strings through StringBuilder instead of chained concat #3

Closed
agra wants to merge 2 commits from string-builder-concat into master
Owner

Tracker: #1635

Strings that grow in a loop or across several appends are built in one StringBuilder instead of chained concat, which copied the whole prefix on every link.

  • store.sx: patch_set, fts_quote, and_clause, placeholders are ufcs methods on *StringBuilder; the task/project UPDATE statements, the task filter, the FTS match and ORDER BY are each written into one builder.
  • api.sx: sse_data / sse_event are ufcs methods writing straight into the frame's builder; payload lines use the slice operator and slice_of is gone.
  • logging.sx: the request line is one builder; config is one variadic concat.

Output bytes are unchanged. Single fixed joins (concat("sak_", hex), concat(root, p)) stay as one concat call.

Verification at ea2bc64 on sx 6f334aa4: cold sx build src/main.sx -o sak ok; tests/*.sx 20 of 20, step9_release against dist/ packaged from ea2bc64.

Head: ea2bc64545

Tracker: [#1635](https://sak.swipelab.com/tasks/1635) Strings that grow in a loop or across several appends are built in one `StringBuilder` instead of chained `concat`, which copied the whole prefix on every link. - `store.sx`: `patch_set`, `fts_quote`, `and_clause`, `placeholders` are ufcs methods on `*StringBuilder`; the task/project `UPDATE` statements, the task filter, the FTS match and `ORDER BY` are each written into one builder. - `api.sx`: `sse_data` / `sse_event` are ufcs methods writing straight into the frame's builder; payload lines use the slice operator and `slice_of` is gone. - `logging.sx`: the request line is one builder; `config` is one variadic `concat`. Output bytes are unchanged. Single fixed joins (`concat("sak_", hex)`, `concat(root, p)`) stay as one `concat` call. Verification at ea2bc64 on sx 6f334aa4: cold `sx build src/main.sx -o sak` ok; `tests/*.sx` 20 of 20, `step9_release` against `dist/` packaged from ea2bc64. Head: ea2bc64545e41df53d131fe162d85415a69dec44
Author
Owner

Superseded by #44, which re-delivers this StringBuilder change on current master (sak task #1635, run contract comment 12565). Closing.

Superseded by https://git.swipelab.com/sx/sak/pulls/44, which re-delivers this StringBuilder change on current master (sak task #1635, run contract comment 12565). Closing.
agra closed this pull request 2026-10-07 17:22:03 +03:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sx/sak!3
No description provided.