Skip to content

Pin ztk to dd10466, with ztcl 0e9e8bf - #69

Open
beetlebugorg wants to merge 1 commit into
mainfrom
pin-ztk-main
Open

beetlebugorg wants to merge 1 commit into
mainfrom
pin-ztk-main

Conversation

@beetlebugorg

Copy link
Copy Markdown
Owner

Pins ztk to dd10466 (main), which pins ztcl to 0e9e8bf (main). The old pin was ztk 31af992 with ztcl 0.1.0-alpha. Part of ztk#353 and ztcl#792.

The new ztcl (ztcl PR 793) keeps the JIT code of a Debug build in the .bss of the program. Before, each stack trace that the debug allocator recorded through JIT code made std.debug load the unwind tables of the program again, into an arena that keeps them.

Start memory of a debug dockyard: dockyard --headless --agent /bin/sh --exit-after-ms 40000 PROJECT, with a main.tcl of one label, VmRSS from /proc every 5 s:

5 s 10 s 20 s 35 s (VmHWM)
main (f884a88) 179 MB 292 MB 292 MB 293 MB
this branch 55 MB 55 MB 57 MB 57 MB

Changes for the new versions:

  • build.zig: the ztcl import is the ztcl module that ztk imports (import_table). ztk now gives its ztcl dependency the option drop, so ztk_dep.builder.dependency("ztcl", ...) made a second module of the same files, and the compile failed with "file exists in modules 'ztcl' and 'ztcl0'".
  • src/app/apps.zig, src/main.zig: ztk.bundle.run now has the environment as an argument. main sets apps.environ; the tests give an empty environment.
  • ztcl now fails set ::dockyard::x when the namespace ::dockyard does not exist, as Tcl does. host.zig, sandbox.zig, guest_release.zig, crash.zig, main.zig, and one audit test create the namespace with namespace eval before they set the variables.

What I ran on Linux: zig build, zig build test-bin and zig-out/bin/test (30 passed, 3 skipped, 0 failed), and zig build -Dtarget=x86_64-windows (builds). I did not run a macOS build.

The new ztcl keeps the JIT code of a Debug build in the .bss of the
program, so a debug dockyard no longer loads the unwind tables again
for each stack trace through JIT code: the start of the headless
window goes from 292 MB to 57 MB of resident memory.

Three changes follow the new versions. The build uses the ztcl module
that ztk imports, since ztk gives ztcl the option drop and a second
dependency made a second module of the same files. ztk.bundle.run now
needs the environment, which main gives to apps. ztcl fails a set of a
variable in a namespace that does not exist, as Tcl does, so the code
creates ::dockyard before it sets the variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant