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

Question: Is it possible? #2

Open
MaestroJurko opened this issue Jun 10, 2015 · 9 comments
Open

Question: Is it possible? #2

MaestroJurko opened this issue Jun 10, 2015 · 9 comments

Comments

@MaestroJurko
Copy link

Question:

I am a bit new to web workers, so maybe this is a stupid question.

I would like to use web worker when angularjs is creating html of data. I have a table, and I use ngRepeat=”tableData”, is it possible to use this lib, for when tableData changes, that processing and appending of the table is done in a web worker?

Is that even possible to do with web workers?

@FredrikSandell
Copy link
Owner

Hi,

It is not a stupid question:) You can use this library to process the data but not to insert it in the table. The web workers have no access to the DOM and are therefore unable to directly manipulate it. You would need to pass the processed data back to the main thread before inserting it in the table. You need to carefully consider if it is worth using web workers for this. Transferring data from or to a web worker (usually) means copying the data, which can be a somewhat expensive operation if it is a large amount of data.
If the processing of the information that you need to insert in the table is CPU intensive and if the resulting processed data is really small this library is a good option.

/Fredrik

@MaestroJurko
Copy link
Author

There is no processing of data, what backends send we display, the problem is, that when we have larger amount of columns in the table, the digest cycle takes longer, and that is what I would like to speed up.

So what I read from your comment, this is not possible to do with web workers.

@MaestroJurko
Copy link
Author

@MaestroJurko MaestroJurko reopened this Jun 11, 2015
@FredrikSandell
Copy link
Owner

That could possibly work. I also know that frameworks like Famous have been able to synchronize CPU intensive operation with the digest cycle. Would it be possible for you to draw on that concept? Chunking the data and loading the data one part at a time, allowing the digest cycle to run in between data loads?

@MaestroJurko
Copy link
Author

$digest cycle is slow when scrolling, when loading it is ok, but scrolling is the problem.

@pulkitsinghal
Copy link

@mato75 - would limiting watchers to only the data you're viewing when scrolling help? http://kamilkp.github.io/angular-vs-repeat/

@MaestroJurko
Copy link
Author

@pulkitsinghal I am using this library, and it is to slow. I would like to combine angular-vs-repeat and watchers.

@pulkitsinghal
Copy link

By this you mean you're already using angular-vs-repeat ? BTW you can reach me for chat on gitter.im

@MaestroJurko
Copy link
Author

Yes already using angular-vs-repeat.

https://gitter.im/mato75

New to gitter.im

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

3 participants