Title: Slow web worker rendering in angular2 ?
Tags: angular;web-worker
Question: I have a list of items which are rendered fast normally (~30 records). But the same list if I render it from web worker is very slow, I can see visually how the elements are painted...
If I check the MessageBroker messages I can see that lot of messages are travelling from the web worker to the UI like createText, createElement, setElementClass etc.
Is it normal that it is that slow rendered from Web Worker, but working fine in normal rendering?
Comment: I have seen it mentioned that using sync event processing improves speed with webworkers a lot. https://github.com/angular/angular/pull/6897 (maybe also https://github.com/angular/angular/pull/6928)

Comment: I suspect they didn't start to optimize webworker rendering yet

Comment: I think the first thing they do should be to batch those messages

Comment: Hmm, 10 characters change, but makes a big difference :) Of course it is not perfect, because if I send a lot of changes it blocks the UI..., but that one I can optimize.

Comment: @GünterZöchbauer if you make it answer I will accept it.

Comment: @TamasHegedus  probably it would definitely help with many requests, thanks also.

Here is the accepted answer: There is an open issue and someone mentioned that Angular2 using WebWorker becomes much faster when events are processed sync.
See also
http://github.com/angular/angular/pull/6897
(maybe also http://github.com/angular/angular/pull/6928)
Comment for this answer: First one make a big difference, the second didn't try, but may be also improve the perf more. thanks


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 6, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:02/21/16', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<angular><web-worker>', 'Title': 'Slow web worker rendering in angular2 ?', 'ViewCount': 508, 'id': 35542421, 'user_AboutMe': '', 'user_AccountId': 3289452.0, 'user_DisplayName': 'eesdil', 'user_Reputation': 1801.0, 'user_Views': 78.0, 'user_id': 2768091.0}}