I took the config from this comment by zah, but changed it a bit ("not release" instead of "debug").
You can place this into <nim folder>/config/nim.cfg or into ` ~/.config/nim.cfg`:
@if unix:
@if not release:
nimcache = "/tmp/nimcache/d/$projectName"
@else:
nimcache = "/tmp/nimcache/r/$projectName"
@end
@end
@if windows:
@if not release:
nimcache = r"C:\Temp\nimcache\d\$projectName"
@else:
nimcache = r"C:\Temp\nimcache\r\$projectName"
@end
@end
You can change the directories to your liking if you want to.
This is mostly useful for big projects with a lot of files, but it may also have some impact on small ones.
Unless there are unnecessary sync() being done, and excluding cache warm-up, there should be no difference between using tmpfs or not.
A quick benchmark with an 80 seconds long compilation on ext4 vs ext4 under eatmydata vs tmpfs shows no difference.