Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement parallel processing for template handling to improve performance #15

Open
franklinjavier opened this issue Apr 29, 2024 · 0 comments

Comments

@franklinjavier
Copy link

franklinjavier commented Apr 29, 2024

for (const template of Object.keys(templatesMap)) {
console.log(`Generating ${template}...`);
const templateStart = Date.now();
await createTemplatePdfs(mapTemplates(template));
const templateEnd = Date.now();
console.log(`${template} generated in ${templateEnd - templateStart}ms`);
}

The code currently processes templates one by one in a serial manner, which might be inefficient if the number of templates is large or if each template takes significant time to process. Using parallel processing could reduce the overall time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant