From ed637e3e9bd9679f7b9d5da3aaecab7de2e9e85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claes=20Wallin=20=28=E9=9F=8B=E5=98=89=E8=AA=A0=29?= Date: Wed, 5 Dec 2018 11:29:21 +0800 Subject: [PATCH] Problem: raco wastes a lot of time It's examining every directory of documentation, rust code etc for racket files to compile, and it's very slow at doing so. Solution: Make `fractalide.src` narrower, with explicit directories. NOTE: `builtins.path` uses its filter function differently from `builtins.filterSource` -- a directory needs to be filtered `true` for `path` to descend into the directory. A `filterSource` condition could have been: (null != builtins.match ((toString ./..) + "(/info.rkt|/(modules|edges|nodes)/rkt/.*)") path) ... but for `path` the `/rkt/.*` needs to be optional so the parent directory matches, and within `/rkt/.*` the `/.*` needs to be optional so the `rkt` directory matches. That's why the slightly convoluted `(/rkt(/.*)?)?`. Now, on my machine the difference is not great, because it takes a ridiculously long time anyway: Before: real 11m33,282s user 0m3,544s sys 0m0,514s After: real 11m22,826s user 0m2,008s sys 0m0,497s One of those minutes is due to fractalide/racket2nix#241, but I think there may also be something odd about my system. Maybe it's the /nix on ZFS, maybe it's something else. --- pkgs/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/default.nix b/pkgs/default.nix index e19b439c..a79f934f 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -39,6 +39,7 @@ pkgs { path = ./..; filter = (path: type: let basePath = baseNameOf path; in + (null != builtins.match ((toString ./..) + "(/info.rkt|/(modules|edges|nodes)(/rkt(/.*)?)?)") path) && (type != "symlink" || null == builtins.match "result.*" basePath) && (null == builtins.match ".*[.]nix" basePath) && (null == builtins.match "[.].*[.]swp" basePath) &&