Overview
| Comment: | Version v15s is included in typeparse.zip: the annotated scope execution time drops from 163 ms to 46–52 ms (compared to 17–19 ms for "bare" Tcl). Profiling revealed that an expression like `X is T = $x` took 3.3 µs. About a third of this time was spent re-parsing the type definition text with every call, while the remainder was consumed by pushing and popping an annotation (a "note"). Changes implemented: Cached classification: The classification of an annotation is now stored within the text object. It is reused as long as the type table remains unchanged; a `type def` operation invalidates this cache. Direct declaration: An expression like `X is T = v` treats the value—which is already of type `T`—as-is. Values without annotations are constructed directly, without an associated "note." Compiled local variables: Within a procedure, names assigned via expressions (e.g., `x = …`, `x is T = …`) are now handled as compiled local variables. Compiled `$a(x)` access: The result is passed directly via the stack, bypassing the interpreter's general result mechanism. These last two improvements are part of the new kernel patch `procedures-typees.patch`, listed last in `ORDRE.txt`. Measurements: Measurement Before After Bare Tcl `X is point = $a` 3.3 µs 0.6 µs — `geo::distance` 14.6 µs 4.7 µs 1.9 µs Bézier 99 ms 53 ms — Area 15 ms 11–13 ms — Bug fixed during development: This issue had existed since version v15g. An element of a `list.T` accessed via a path (e.g., `lindex $t(children) 0`) would lose its type information whenever the list content was shared. It is now correctly typed in all cases. The file `arbre_graphe.tcl` relied on this behavior and broke during the development process, prior to this fix. Verifications: The new t73 test produces the same output as v15. Valgrind reports no issues in either compact mode, aside from the usual leaks upon exiting `executable_pe`. The full Tcl test suite shows the same 61 failures as v15. Version v15s is documented in `LISEZMOI.md` and in section 15 of `ANNOTATIONS.fr.md`. I have updated the "Performance" item in the roadmap and removed `tclTypePath.c.avant_index` from the package—a backup file that had been included by mistake since October 19th. `dedans_tous` remains unchanged (≈ 255 ms, compared to 65 ms in raw Tcl). Most of this time is spent on `$a(y)` lookups within `expr` (≈ 0.2 µs each, versus 0.06 µs for an index-based lookup). This is the next target on the roadmap. |
|---|---|
| Timelines: | family | ancestors | descendants | both | tip-764_tcl90 |
| Files: | files | file ages | folders |
| SHA3-256: |
9ac2319e262014533b46003755f2c1d2 |
| User & Date: | Florentis on 2026-10-24 09:52:53.923 |
| Other Links: | branch diff | manifest | tags |
Context
|
2026-10-24
| ||
| 11:46 | The v15t version is in typeparse.zip. Point 1: `type def {-compact}pointC {…}` is accepted, and a... check-in: e5b7824c45 user: Florentis tags: tip-764_tcl90 | |
| 09:52 | Version v15s is included in typeparse.zip: the annotated scope execution time drops from 163 ms to 4... check-in: 9ac2319e26 user: Florentis tags: tip-764_tcl90 | |
| 04:37 | V15q `type def {-compact}T`, `type is {compact?}`, and `type {c!}export` are now in place, following... check-in: 7952bb1028 user: Florentis tags: tip-764_tcl90 | |
Changes
Modified generic/tclAnnotObj.c
from [64d52d45c8]
to [82339b951f].
[diff]
Modified generic/tclCompExpr.c
from [0b037260ac]
to [1e692bff56].
[diff]
Modified generic/tclExecute.c
from [1cd33cd0b7]
to [4b61ef36b2].
[diff]
Modified generic/tclTypeGeneric.c
from [de8fc77268]
to [f979202b9e].
[diff]
Modified generic/tclTypePath.c
from [b8eb88c334]
to [4ae0792968].
[diff]
Modified generic/tclTypedVar.c
from [0a1d9f233c]
to [d9a35bb8db].
[diff]
Modified generic/tclTypes.c
from [36f976ecf9]
to [143e70d7fa].
[diff]
Modified generic/tclTypes.h
from [3aae820fed]
to [53d1e8f269].
[diff]
Modified generic/tclTypesInt.h
from [84283d90f6]
to [f8ef7beb0d].
[diff]
Modified typeparse/doc/ANNOTATIONS.fr.md
from [65142c1a2c]
to [bf78ce8084].
[diff]
Modified typeparse/noyau/LISEZMOI.md
from [6ab343e718]
to [ef76b4d6ed].
[diff]
Modified typeparse/noyau/ORDRE.txt
from [6040ce727b]
to [8167bca376].
[diff]
Added typeparse/noyau/procedures-typees.patch version [233749275b].
Modified typeparse/tclAnnotObj.c
from [64d52d45c8]
to [82339b951f].
[diff]
Modified typeparse/tclTypeGeneric.c
from [53d03f8644]
to [f979202b9e].
[diff]
Modified typeparse/tclTypePath.c
from [b8eb88c334]
to [4ae0792968].
[diff]
Modified typeparse/tclTypedVar.c
from [0a1d9f233c]
to [d9a35bb8db].
[diff]
Modified typeparse/tclTypes.c
from [36f976ecf9]
to [143e70d7fa].
[diff]
Modified typeparse/tclTypes.h
from [3aae820fed]
to [53d1e8f269].
[diff]
Modified typeparse/tclTypesInt.h
from [71ea6b9d17]
to [f8ef7beb0d].
[diff]
Modified typeparse/tests_tclsh/t28_type_deref.tcl.out
from [84eb65e826]
to [3a86f9298c].
[diff]
Modified typeparse/tests_tclsh/t68_lset_reference.out
from [9683946b2a]
to [cb64fc4726].
[diff]
Modified typeparse/tests_tclsh/t68_lset_reference.tcl
from [bc0e405fa0]
to [9bc7ae6ac0].
[diff]
Added typeparse/tests_tclsh/t73_procedures_typees.out version [6d599fb51a].
Added typeparse/tests_tclsh/t73_procedures_typees.tcl version [7812bf6641].