-
Notifications
You must be signed in to change notification settings - Fork 23
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
ViewModel decreases Blaze performance x3 ~ x10 #290
Comments
Yeah, there has to be plenty of low hanging fruit since I've spent exactly 0s optimizing VM =/ Thank you for setting this up! I really appreciate it. |
+1 this, any improvements you can do Manuel are greatly appreciated! |
I have a very large app running Blaze and Viewmodel, most of the time it is not an issue, but sometimes I would enjoy some performance benefits. |
I don't have anything in mind right now (haven't worked on the Blaze version in years). You can just create a page and repeat an object hundreds of times and see what the hot paths are. Repeat the same process for other things like bindings, handling events, etc. |
@mitar built an UI benchmarking tool for Meteor. It included Blaze, vanilla JS, Blaze Components, Vue and React.
Blaze Components turned out to be really slow compared to plain Blaze.
I then created a fork of the tool with ViewModel included and found out ViewModel is even slower, in some tests a lot slower.
All frameworks compared:
Full results
Detailed comparison of just Blaze and ViewModel:
Full results
As you can see, ViewModel's results seem to be about 4x-5x larger than those of plain Blaze (for example, rendering table1, Blaze takes about ~3500ms, ViewModel variant takes ~ 16000ms).
However, the biggest difference is in the recursive test, in which Blaze succeeds in approximately 16 000ms, ViewModel takes a whopping ~100 000 ms.
Profiling the execution with Chrome's Dev Tools Performance tab, there seems to be a few time hogs, one related to firing a lot of timers.
Also, this isn't just a benchmarking problem. I had a real world app with a dynamic table with typically ~100 rows. First draft used ViewModel, with approximate rendering time of 16 seconds. After refactoring to pure Blaze the rendering time dropped to about 3-4 seconds.
Maybe there's a low hanging fruit with a tenfold speed improvement for ViewModel in some scenarios?
The text was updated successfully, but these errors were encountered: