The Racket repository
![]() In particular, instead of going directly back to the chaperone, handle the case where the function doesn't accept keyword arguments with a less expensive fallback. The less expensive fallback uses a case-lambda wrapper (wrapped inside a make-keyword-procedure) to close over the neg-party and avoid the chaperone creation. With this commit, the program below gets about 3x faster, and is only about 20% slower than the version that replaces the "(let ([f f]) ...)" with its body #lang racket/base (module m racket/base (require racket/contract/base) (provide (contract-out [f (-> integer? integer?)])) (define (f x) x)) (require 'm) (collect-garbage) (time (for ([x (in-range 5000000)]) (let ([f f]) (f 1)))) Thanks, @samth! |
||
---|---|---|
pkgs | ||
racket | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
.travis.yml | ||
appveyor.yml | ||
INSTALL.txt | ||
Makefile | ||
README.txt |
This is the source code for the main Racket distribution. See "INSTALL.txt" for information on building Racket. License ------- Racket Copyright (c) 2010-2015 PLT Design Inc. Racket is distributed under the GNU Lesser General Public License (LGPL). This implies that you may link Racket into proprietary applications, provided you follow the rules stated in the LGPL. You can also modify Racket; if you distribute a modified version, you must distribute it under the terms of the LGPL, which in particular states that you must release the source code for the modified software. See racket/src/COPYING_LESSER.txt for more information.