Skip to content

Commit

Permalink
Problem: raco wastes a lot of time
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
clacke committed Dec 5, 2018
1 parent c59f7d5 commit ed637e3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down

0 comments on commit ed637e3

Please sign in to comment.