Overview
| Comment: | Point 2 is complete and documented. All that remains is to wait for Valgrind and the full Tcl test suite—which are currently running in the background (taking about 40 minutes)—before sending the zip file. Previous behavior: Each read operation `$a(x)` would look up the field by its name and follow general path-resolution rules. Subsequently, `expr` would receive a typed value, causing it to exit its optimized "fast path" for numeric operations. Changes: Field caching: The index of a compiled read (the `x` in `$a(x)`) now stores the previously encountered type and the field's location. Subsequent reads involving the same type proceed directly to the element. Sums, variable links (`var`), and `list.any` continue to use the general path-resolution mechanism. Typed numbers in `expr`: An operand typed as `int` or `double` is now read directly from its underlying content. This is implemented via a new core patch, `expr-nombres-types.patch` (in `tclExecute.c`). The result is never written back into the operand; thus, a variable such as `{double}d` remains unchanged—a fact verified by the test suite. Measurements (10,000 points): Bare Tcl v15s current reading $a(x) within expr 0.05 µs (lindex) ≈ 0.52 µs 0.14 µs foreach a $P {set s [expr {$s + $a(x)}]} 0.64 ms 5.2 ms 1.5 ms Geometry, performance gap relative to the baseline (bare Tcl): calculation v15s v15u v15v area / 3.4 / 2.2 / 1.8 perimeter / 2.7 / 1.9 / 2.1 bounding box / 6.7 / 3.7 / 3.0 inside_all / 3.6 / 2.6 / 2.1 Bézier / 2.7 / 2.4 / 2.4 The perimeter figure shows a slight regression, from / 1.9 to / 2.1. This is likely measurement noise; this calculation primarily involves procedure calls. What remains during the read operation is the creation and subsequent release of the field's typed value. Eliminating this would require the `expr` command to know—at compile time—that it only requires a numeric value, which is a separate, more complex undertaking. Verified so far: All 54 tests pass, including the new `t76_lecture_champ` (field read) test, which produces the same output as it did before the change. Results are identical whether the compact form is used or not. |
|---|---|
| Timelines: | family | ancestors | descendants | both | tip-764_tcl90 |
| Files: | files | file ages | folders |
| SHA3-256: |
4269a60689dfe4551a10521297236afb |
| User & Date: | Florentis on 2026-10-24 13:29:48.505 |
| Other Links: | branch diff | manifest | tags |
Context
|
2026-10-24
| ||
| 18:37 | What changes: Consider a list stored in contiguous memory blocks ("cases") where the layout of the e... check-in: 2e48702b89 user: Florentis tags: tip-764_tcl90 | |
| 13:29 | Point 2 is complete and documented. All that remains is to wait for Valgrind and the full Tcl test s... check-in: 4269a60689 user: Florentis tags: tip-764_tcl90 | |
| 13:16 | Version v15u is included in typeparse.zip. Loops over a typed list no longer recreate their elements... check-in: 92c0c64aa5 user: Florentis tags: tip-764_tcl90 | |
Changes
Modified generic/tclAnnotObj.c
from [c051e54058]
to [ef25bf0816].
[diff]
Modified generic/tclExecute.c
from [59f7f003d2]
to [b49bf9d825].
[diff]
Modified generic/tclTypePath.c
from [4ae0792968]
to [e5c62dfdd9].
[diff]
Modified generic/tclTypes.h
from [844c350cc9]
to [6986b39a55].
[diff]
Modified typeparse/REPRISE.md
from [cfc31c9ab1]
to [48a915d211].
[diff]
Modified typeparse/doc/ANNOTATIONS.fr.md
from [f3fe66369b]
to [68505cc9fb].
[diff]
Modified typeparse/exemples/geometrie/LISEZMOI.md
from [31d189d036]
to [6f9c80b008].
[diff]
Modified typeparse/noyau/LISEZMOI.md
from [40b10151d3]
to [1954d3a5c5].
[diff]
Modified typeparse/noyau/ORDRE.txt
from [a36ccd4b56]
to [52996e2625].
[diff]
Added typeparse/noyau/expr-nombres-types.patch version [99fb30635e].
Modified typeparse/tclAnnotObj.c
from [c051e54058]
to [ef25bf0816].
[diff]
Modified typeparse/tclTypePath.c
from [4ae0792968]
to [e5c62dfdd9].
[diff]
Modified typeparse/tclTypes.h
from [844c350cc9]
to [6986b39a55].
[diff]
Added typeparse/tests_tclsh/t76_lecture_champ.out version [6a5fd3298b].
Added typeparse/tests_tclsh/t76_lecture_champ.tcl version [bbc95baa40].