[PATCH] v4 recycle kernel cache via weak pointer

3 views
Skip to first unread message

Qian Yun

unread,
May 15, 2026, 12:28:23 AM (yesterday) May 15
to fricas-devel
Added support for clisp, cmucl, ecl, sbcl.

Benchmark (execution time and memory footprint) for mapleok.input:
(after patch vs before patch)

====
)time long
)storage long
systemCommand "read src/input/mapleok.input"
====

sbcl:
10.2s 7.5GB vs 14.4s 13.5GB

cmucl:
17.4s 5.3GB vs 24.9s 8.3GB

clisp:
132s 7.7GB vs 222s 13.7GB

ecl:
46s vs 79s


I've added debugging facility, so that you can test its effects
without compiling twice:

by using "setExpandCacheThreshold(6000)$SCACHE Kernel EXPR INT"
you effectively disable recycle on kernel cache.


I'll try to find more benchmarks as well.

BTW, lispworks and clozurecl doesn't have weak pointers,
but lispworks has weak hashtable and clozurecl has weak array.
They can be implemented, but a bit more complicated.

- Qian
recycle-kernel-cache-v4.patch

Qian Yun

unread,
May 15, 2026, 5:54:48 AM (24 hours ago) May 15
to fricas-devel
Benchmark on integ.input (replace the 2 "testcase" with
"testcaseNoClear"):

Kernels drop from 4461 to 831 with patch.

(before vs after)

clisp:
78.6s (18.0s GC) 4.4GB vs 70.1s (16.8s GC) 4.2GB

sbcl:
8.9s (0.3s GC) 7.5GB vs 8.0s (0.6s GC) 7.3GB

cmucl:
18.4s (2.9s GC) 8.1GB vs 14.2 (2.5s GC) 4.8GB

ecl:
27.7s vs 23.7s

- Qian

Qian Yun

unread,
May 15, 2026, 11:46:53 PM (6 hours ago) May 15
to fricas-devel
Simplified the code a bit more. See attachment.

- Qian
recycle-kernel-cache-v5.patch
Reply all
Reply to author
Forward
0 new messages