You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, I see no benefit to run the builds (pages) sequential. We can improve the performance by a factor of 5x if we run them in parallel. Or do I miss something?
Example
prebuild-worker.js
'use strict';const{ run }=require('@marko/prebuild');constlassoConfig=require('./src/lasso-config');asyncfunctionprebuild(path){awaitrun({config: lassoConfig,// Either a lasso config object, or a path to one.flags: [],// Lasso flags to use when building the pages.pages: [path]});}prebuild(process.argv[2]).catch(err=>{throwerr;});
prebuild.js
'use strict';constglobby=require('globby');constexeca=require('execa');asyncfunctionprebuild(){constops=(awaitglobby(['src/pages/*/*.marko'])).map(path=>execa('node',['prebuild-worker.js',path]));awaitPromise.all(ops);// All templates have their prebuild.json files written to disk.console.log(`Prebuild completed!`);}prebuild().catch(err=>{throwerr;});
Benchmark
CPU: AMD Ryzen 5 2600X (12) @ 3.600G
SSD
12 pages, 30 components with sass, babel, minifying, bundling
~80sec
~17sec with the solution above
The text was updated successfully, but these errors were encountered:
Currently, I see no benefit to run the builds (pages) sequential. We can improve the performance by a factor of 5x if we run them in parallel. Or do I miss something?
Example
prebuild-worker.js
prebuild.js
Benchmark
CPU: AMD Ryzen 5 2600X (12) @ 3.600G
SSD
12 pages, 30 components with sass, babel, minifying, bundling
The text was updated successfully, but these errors were encountered: