The Racket repository
![]() This wouldn't matter if the dependencies recorded in the dep file were exactly the same as the files that are actually loaded when a file is required. But in the case of lazy-require (or, more accurately, when the cm-accomplice library is used), the dependencies in the dep files can include things that are, in some cases, not actually required. This is no problem for raco setup, since it looks at all of the files anyway, but it can cause a particularly bad interaction with DrRacket's online compilation facility. For example say there is some file, e.g., mzscheme/main that is required lazily. So when you edit a file in DrRacket, it will traverse the requires and lets say it sees that the of mzscheme/main's dependencies need to be compiled. So it will compile that dependency, and then the ormap in this commit will be shortcircuited, which will cause CM to stop looking at dependencies and decide to compile mzscheme/main. So DrRacket will compile mzscheme/main, and then whatever other pending compiles were going on and DrRacket's online check syntax will complete, but because the lazy require doesn't triggered, mzscheme/main isn't actually loaded during compilation. Now you make another edit to the buffer and the same thing happens except this time it gets past that first dependency of mzscheme/main because there is now a .zo file for it from the last go 'round. But say there isn't one for the second dependency. So it compiles that file and compiles mzscheme/main now for a second time, but still doesn't look at the third and fourth (etc) dependencies of mzscheme/main. Overall, this means that the second time you edit you file in DrRacket, it should have been quick for the expansion portion to finish because, after all, everything has been compiled and should have been cached in .zo files. But because of the short circuiting, it the .zo files weren't actually created and so your second edit is also slow to come back. After this commit, because of the ormap, the second edit will be faster. One worry with this commit is that it might change something that could cause raco setup to go slower. To test that, I applied only this change to a fresh checkout and did a full build. I then deleted all zo files in racket/share/pkgs and timed 'raco setup -D' twice (four times total). Here are the timings I get. The version of the code that uses ormap: % ... delete .zo files ... % time raco setup -D real 9m2.354s user 37m5.176s sys 4m14.963s % ... delete .zo files ... % time raco setup -D real 9m2.421s user 37m43.793s sys 4m23.111s The version of the code that uses the change in this commit: % ... delete .zo files ... % time raco setup -D real 8m58.852s user 36m51.369s sys 4m13.633s % ... delete .zo files ... % time raco setup -D real 8m53.980s user 37m40.262s sys 4m23.692s |
||
---|---|---|
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-2016 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.