BorisMoore / jsviews

Interactive data-driven views, MVVM and MVP, built on top of JsRender templates
http://www.jsviews.com/#jsviews
MIT License
856 stars 130 forks source link

Performance concerns "jsrender + manual dom manipulation" vs "jsviews" #371

Closed offtopic closed 7 years ago

offtopic commented 7 years ago

Hello, thanks for your great project, but I have some concerns for my use case:

I have to render a big table (around 20 cols) - up to 500 to 1000 rows with several bindings in each cell. The table is an hierarchy (up to 8 levels with editable cells (amounts) and sums in rows and sums on parents aggregated to the top of the hierarchy.

So the main question is: should I stay with jsrender and do all the updates by hand (jquery + dom manipulation) - or can I use jsview bindings with proper performance.

Thanks, offtopic

Paul-Martin commented 7 years ago

I suspect the correct answer to your question is to build a test case and measure the performance. Only you can determine if the resulting performance is acceptable for your use case. Here is a very recent thread on this exact topic that has a number of techniques you can employ to increase performance with JSViews when rendering large tables: https://github.com/BorisMoore/jsviews/issues/366

BorisMoore commented 7 years ago

Yes, I agree with Paul. It depends also on your specific scenarios. For example if you want to provide sorting on your list, then using JsViews will allow you to sort without re-rendering the rows (they just get 'shuffled') so it will probably be faster than if you use JsRender alone and re-render the whole table. Also it allows you to conserve state, and avoid re-rendering flicker, etc. so the user experience may be much better.

But for the initial rendering and linking you may need to be smart about using an appropriate optimal approach. (See that link #366 for some discussion)

BorisMoore commented 7 years ago

@offtopic - didn't hear back from you in response, but I'll close this, as answered.