New StylesheetProcessor implementation is extremly slow
See original GitHub issueType of Issue
The new implementation of the StylesheetProcessor
using workers is extremly slow
[x] Bug Report
[ ] Feature Request
Description
I have added a console.time('StylesheetProcessor')
at the beginning of the StylesheetProcessor.process
call and a console.timeEnd('StylesheetProcessor')
before the css return statement, these are the results:
ng-packagr@11.1.4
- Compiling TypeScript sources through NGC
StylesheetProcessor: 12.902ms
StylesheetProcessor: 8.599ms
StylesheetProcessor: 8.728ms
StylesheetProcessor: 19.27ms
StylesheetProcessor: 13.624ms
StylesheetProcessor: 9.034ms
StylesheetProcessor: 10.043ms
StylesheetProcessor: 24.805ms
StylesheetProcessor: 28.633ms
StylesheetProcessor: 7.321ms
StylesheetProcessor: 44.461ms
StylesheetProcessor: 21.771ms
StylesheetProcessor: 19.549ms
StylesheetProcessor: 6.383ms
StylesheetProcessor: 13.473ms
StylesheetProcessor: 6.555ms
StylesheetProcessor: 21.906ms
StylesheetProcessor: 8.931ms
StylesheetProcessor: 8.84ms
StylesheetProcessor: 18.113ms
ng-packagr@11.2.0
- Compiling TypeScript sources through NGC
StylesheetProcessor: 1.396s
StylesheetProcessor: 1.438s
StylesheetProcessor: 1.391s
StylesheetProcessor: 1.408s
StylesheetProcessor: 1.354s
StylesheetProcessor: 1.374s
StylesheetProcessor: 1.383s
StylesheetProcessor: 1.435s
StylesheetProcessor: 1.945s
StylesheetProcessor: 2.004s
StylesheetProcessor: 1.703s
StylesheetProcessor: 1.619s
StylesheetProcessor: 1.657s
StylesheetProcessor: 1.484s
StylesheetProcessor: 1.579s
StylesheetProcessor: 1.456s
StylesheetProcessor: 1.438s
StylesheetProcessor: 1.362s
StylesheetProcessor: 1.368s
StylesheetProcessor: 1.428s
I think the problem is, that every time a file must be processed a worker is started, instead of reusing an existing one.
Version Information
@angular/*: 11.2.0
typescript: 4.1.5
rxjs: 6.3.3
node: 14.15.4
npm/yarn: 1.22.5
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (8 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@skrtheboss, oh wow that’s an interesting package. Thanks for sharing let me try it out.
Hi @alan-agius4,
Yes I am in deed using windows… But i found a better solution for solving this problem and i have created a pull request. Its inspired by how its done in the babel-plugin-postcss usin the sync-rpc library.
On my machine the performance is way better now: