direct-var? now treats a cfunction root the same as a function root, so a call/ref to a native fn (clojure.math/sqrt et al.) embeds the value instead of a per-call cell deref. This was the hot indirection in the ray tracer — sqrt runs every bounce — and it applies in every direct-link build, not just whole-program. const-link? is new and whole-program-only: in a closed world every non-dynamic var has a stable root, so embed it as a constant (quoted unless it's already callable) rather than reading the cell each reference. Covers what direct-var? can't — ^:redef vars (reloading is off under the flag), data defs, and record type/ctor roots. Dynamic vars stay indirect; a nil (not-yet-defined) root stays indirect and the whole-program re-emit picks it up once the root is in place. Measured on the records ray tracer: hot-path indirect refs (sqrt + data vars) gone; the only indirect refs left are cold defrecord self-references. whole- program-test now also checks a ^:redef fn and a data def so the per-ns vs whole-program comparison guards const-link soundness. |
||
|---|---|---|
| .. | ||
| bench | ||
| clojure-stdlib/clojure | ||
| integration | ||
| spec | ||
| support | ||
| unit | ||