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
Bad performance when selecting a huge range #778
Comments
It can, but considering the borderline unrealistic expectations, I can't really prioritize this over other work. However, if you really insist on implementing a web app that tackles 8M data items, you are likely to hit a thousand other bottlenecks in a bunch of areas :) In case you do decide to tackle it, I'll provide you with the rough plan of attack below. The current bottlenecks in SlickGrid are:
|
Thanks for your thorough answer!
I noticed this too. I was wondering why ranges are used at all? I haven't looked at all of the code, so forgive me if I'm missing something. Why not just an array of selected indexes?
This is what kills it, even on modern browsers. Latest Chrome and Firefox chokes here. This could be done on the fly, when displaying rows, given an array of selected indexes, right? |
|
|
Selection isn't just a matter of updating the UI. It's part of the API. It needs to tell the truth, so a selection model CANNOT set the selection to something that is unselectable. |
Also, "crashing" is not a good indicator of where things go wrong. Reduce the size to 500K and benchmark both performance and memory use. |
But it already does? Rows are selected, only after that are individual cells interrogated for their ability to be selected. I'm suggesting that this interrogation could be done lazily instead of greedy. I noticed that if I limit the cell checking (and setting style) to the first column, that it at least worked. It wasn't fast, but it wasn't terrible either. |
No, it does NOT do it already. As I already mentioned, it has to do it On Oct 12, 2013 1:25 PM, "Robert Jeppesen" notifications@github.com wrote:
|
"However, if you really insist on implementing a web app that tackles 8M data items, you are likely to hit a thousand other bottlenecks in a bunch of areas :)" I tried this with < 1 000 000 rows and it crasched! |
In profiling the select-all for 500K rows with the row selection model, canCellBeSelected() calls only contribute 6.24% of the time spent. On my MacBook Air in Chrome, selecting everything takes 1.4 seconds. FF was only half a second slower. Not too terrible. At this point, I'm going to have to say that I'm not going to pursue this any further. Practically nobody needs the support for these numbers of items, and I'm perfectly fine with good selection performance of at least 100K. That said, I believe I provided you with a plan on how you can improve the selection provider (or write a new one geared towards large selections) and the grid to support a practically unlimited selection if your app requires it. If you do end up making those changes, I'm always open to contributions :) |
I know I'm late to the game and I'm only loading 250K of rows. Thanks |
- rollback PR mleibman#769 that brough event passive mode, it turns out that all our SlickGrid events can use `preventDefault` which is what passive mode is for, so it's better to rollback all of it
When loading 8 million rows, selecting a range of about half of them will crash the browser tab in Chrome, Firefox, probably all of them.
Try it out in this reduced sample: http://jsfiddle.net/D9TYR/1/
The real code uses RemoteModel and also exhibits the problem.
Can the performance here be improved?
The text was updated successfully, but these errors were encountered: