Overview
| Comment: | What changes: Consider a list stored in contiguous memory blocks ("cases") where the layout of the elements matches the requested byte representation exactly—same values in the same positions, same size, and following the machine's byte order. Encoding copies these blocks as a single unit, provided there is no padding. Decoding populates these blocks directly, without creating individual objects for each element. This only applies to lists already stored in contiguous blocks (and not when the `-strictpad` option is used). In all other cases, nothing changes. Benchmarks (for a `polyC` with 10,000 points, using `-align natural`): operation | without contiguous blocks | with contiguous blocks encoding | 474 µs | 15 µs decoding | 3,056 µs |10 µs In `geo_c.tcl`, when using `{-compact}pointC`, the byte-processing path for an area now takes approximately 1.0 ms—down from 4.5 ms in v15t—or 1.2 ms without the `{-compact}` option. Encoding now accounts for only a small fraction of this time. The bulk of the processing occurs during the construction of the `polyC` from the polygon: extracting content: 0.25 ms; normalizing numbers: 0.59 ms. The logical next step would be to implement a cast from `list.point` to `list.pointC` that copies the contiguous memory blocks directly—since their layouts are identical—bypassing any text-based conversion. I have left `geo_c.tcl` as is for now. Status: All 55 tests pass, including the new `t77_binaire_cases` test. It produces the same bytes as the Tcl codec—both with and without padding—using the 'natural', 'packed', and '4' formats. It also handles decoding, alternative byte order, the '-strictpad' option, an incorrect count, and an empty list, yielding the same output as in version 15v. The output remains the same whether or not the compact form is used. As before, a compact form using a byte order different from that of the host machine is rejected. |
|---|---|
| Timelines: | family | ancestors | descendants | both | tip-764_tcl90 |
| Files: | files | file ages | folders |
| SHA3-256: |
2e48702b8912b0b6eba04c954b6abc1d |
| User & Date: | Florentis on 2026-10-24 18:37:05.132 |
| Other Links: | branch diff | manifest | tags |
Context
|
2026-10-25
| ||
| 03:35 | What changes: Consider a list stored in contiguous memory blocks ("cases") where the layout of the e... check-in: 06ad98bead user: Florentis tags: tip-764_tcl90 | |
|
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 | |
Changes
Modified generic/tclAnnotObj.c
from [ef25bf0816]
to [b686c96bb8].
[diff]
Modified generic/tclTypes.c
from [5b8acd054c]
to [b865af4661].
[diff]
Modified generic/tclTypes.h
from [6986b39a55]
to [c7b58abb50].
[diff]
Modified typeparse/REPRISE.md
from [48a915d211]
to [04e88e496f].
[diff]
Modified typeparse/doc/ANNOTATIONS.fr.md
from [68505cc9fb]
to [5ff1a2fd3e].
[diff]
Modified typeparse/noyau/LISEZMOI.md
from [1954d3a5c5]
to [2d4ab0dc1f].
[diff]
Modified typeparse/tclAnnotObj.c
from [ef25bf0816]
to [b686c96bb8].
[diff]
Modified typeparse/tclTypes.c
from [5b8acd054c]
to [b865af4661].
[diff]
Modified typeparse/tclTypes.h
from [6986b39a55]
to [c7b58abb50].
[diff]
Added typeparse/tests_tclsh/t77_binaire_cases.out version [7183356725].
Added typeparse/tests_tclsh/t77_binaire_cases.tcl version [b366f7ce98].