Long runtime on large-ish project, even with all optimizations switched off
jazmit opened this issue · 6 comments
Running on our medium-sized project (10k LOC of purescript app code + 30k LOC purescript library code, 2.5Mb after pulp browserify -O
), the runtime is more than an hour, even with all optimizations turned off.
The list of warnings is printed relatively quickly, then rollup hangs for over an hour on my laptop before printing the optimization stats and exiting.
I'm sorry I haven't had time to dig further into this, as we're sticking with pulp for now, but I'd thought I'd create this issue to let others know and get some discussion going.
I'm running NixOS, and installed rollup globally in my user profile. We're using the following rollup.config:
import purs from "rollup-plugin-purs";
export default {
entry: "src/Main.purs",
format: "iife",
sourceMap: true,
moduleName: "PS",
plugins: [
purs({
runMain: false,
optimizations: {
uncurry: false, // Whether to apply the uncurrying optimization or not
inline: false, // Whether to inline some functions or not
removeDeadCode: false, // Whether to remove dead code or not
assumePureVars: false // Whether to assume that variable assignment is always pure
}
})
]
};
Yes, I've noticed this as well. I'm not sure what the problem is, but I suspect it has to do with Rollup itself.
Hey, I really wanted to use this plugin but had the same issue. After some digging and experimentation, I found that the major slowdown is in the replace.js transformation.
The rest is quite fast, apart from transform-es2015-block-scoping which is slowish, but on my small-medium project at around 10 secs it's not really a problem for a production build.
$removeIIFE raises a stack size error, which goes away when I use eg: --stack-size=2000.
@FrigoEU Thanks for the information! I'll look into this and see if I can improve the performance.
I was looking into this, but couldn't figure out what the replace plugin is supposed to do? It just renames every identifier, and nothing else?