Hi all, as promised, here are some performance results for the current elisp compiler. BTW, it supports now to disable checks for void-value on variable access via compiler options as well as the lexical-let/lexical-let* constructs that should mimic the ones from emacs' cl package (but in emacs they degrade performance, in Guile they improve it). Lambda arguments are still always dynamically bound, which is quite a pity as it inhibits tail-call optimization; I'll work on a compiler option to always bind certain or all symbols lexically, including lambda arguments to counter this (and there's also an emacs branch doing this, so we're ultimatly even trying to be compatible...). For the timings, I used a simple prime sieve implemented imperatively with while and set's, because the recursive one would put elisp without tail-calls at a disadvantage (and because lexical binding does not yet work for lambda arguments); the code is attached. Both Scheme and Elisp version are identical with just syntax changed (set! -> setq, define -> defun, begin -> progn). Additionally, for lexical let all let's were replaced by lexical-let's in the elisp version. Here are the results: Iterative prime sieve, (length (find-primes-to 5000)): Scheme: 0.42s Elisp, no void checks, lexical let: 3.40s Elisp, no void checks, dynamic let: 4.43s Elisp, void checks, dynamic let: 5.12s Elisp, void checks, lexical let: 4.06s So it apparent that both disabling void checks and using lexical let's instead of the standard dynamic ones improve performance notably. However, were quite out of reach of the Scheme version. My conjecture is that the remaining bottle-neck are the primitive calls, as they are still resolved using the dynamic-binding and fluid mechanisms; so maybe it is really a good idea to change function bindings to just global ones without dynamic scoping, and implement flet/flet* with dynamic-wind. In contrast to variables, for functions access performance is a lot more important than let performance, I guess, so this might be the way to go. What do you think? As another test I implemented just a small loop, again both in Scheme and Elisp with identical code (also attached). Here are the timing results: Tight loop, (test 1000000): Scheme: 0.72s Elisp, no void checks, lexical let: 2.33s Elisp, no void checks, lexical let, guile-ref: 1.29s Elisp, no void checks, lexical let, guile-primitive: 0.92s In the guile-ref and guile-primitive runs, I replaced both primitives (< and 1+) using the extension constructs (guile-ref (guile) (set! + (lambda (a b) 42)) scheme@(guile-user)> + #:0:8 (a b)> scheme@(guile-user)> (+ 1 2) 3 scheme@(guile-user)> (let ((+ (lambda (a b) 42))) ... (+ 1 2)) 42 So it seems that the Scheme compiler just ignores this possibility... Is (set! + ...) and expecting (+ 1 2) to change invalid, or should this strictly be regarded as a bug? In any case, because of dynamic scoping and the expected behaviour of flet to change possibly primitives during its extent, I think we can't do anything like that for Elisp (except providing guile-primitive for hand-optimizing such calls). Yours, Daniel -- Done: Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz To go: Hea-Kni-Mon-Pri