Skip to content
Tcl Source Code Check-in [7a6b2e2ffd]
Login

Check-in [7a6b2e2ffd]

Overview
Comment:The two regressions have been addressed in v16f. `lassign $it(*)` has returned to its previous performance level. The object-based approach is now the fastest when using the compact format, though it remains slow in the standard format. `$P(*)`: Reading all components of a typed product now utilizes a shortcut when all its fields are simple (i.e., containing no sums, links, or `any` types). The result remains the same as before: a `list.T` if all fields share the same type, or a `list.any` of typed fields otherwise. For a `Sample` with three fields, the execution time drops from 2.4 µs to 0.7 µs. Other cases continue to follow the general processing path. `cstruct.c`: The object-based approach now uses `tclAnnotatedApi.h`, similar to `geo.c`. In the compact format, measurements are read directly from their storage slots. In the standard format, the process still goes through an intermediary layer that requests the full content of the batch from Tcl; only a true stub function would be able to read this content in-place. Measurements (in µs) for a batch of 10,000 items: Step Before (v16e) v16f (standard) v16f (compact) 5b `lassign $it(*)` 15,300 7,600 7,600 7 Object-based `cs::stats_obj` 2,400–2,800 1,900 20 6 Full chain `cs::stats` 1,600 1,200 280 In the compact format, the object-based approach (20 µs) is now faster than the encoding-plus-byte-stream chain (280 µs). It is even as fast as performing the calculation alone on data already available as bytes (17 µs). Verifications: All 66 tests pass, in both the standard and compact formats. The new `t88` test covers the scenarios involving `$P(*)`. The outputs are identical to those of v16b, with the exception of the three tests that count the generated instructions. cstruct/test.tcl produces the same output as v16b in both forms, and Valgrind reports no issues. A full Valgrind run reveals nothing new, and the complete `make test` suite shows the same 61 failures as the reference.
Timelines: family | ancestors | descendants | both | tip-764_tcl90
Files: files | file ages | folders
SHA3-256: 7a6b2e2ffd9deaf4237ae9a52168e12ecd3a18a478da6f5189450f3dc9358496
User & Date: Florentis on 2026-10-25 13:49:02.234
Other Links: branch diff | manifest | tags
Context
2026-10-25
18:18
Version 16g has been released. The `set {point}A ​​1.0 2.0` operation has improved from 1.3 µs ... check-in: 2cbd5d6000 user: Florentis tags: tip-764_tcl90
13:49
The two regressions have been addressed in v16f. `lassign $it(*)` has returned to its previous perfo... check-in: 7a6b2e2ffd user: Florentis tags: tip-764_tcl90
13:02
I have updated `bench_cstruct.tcl` and re-run it on v16e: in compact mode, the full sequence runs 15... check-in: 23da210385 user: Florentis tags: tip-764_tcl90
Changes