drugis / mcda-elicitation-web

HTML/JavaScript GUI for MCDA preference elicitation
GNU General Public License v3.0
2 stars 13 forks source link

Client-side performance #40

Closed joelkuiper closed 5 years ago

joelkuiper commented 11 years ago

We should start to worry about the performance of the (angular.js) client-side. Especially the overview page is slow due to a large amount of bindings.

We could check-out https://github.com/Pasvaz/bindonce for some of the bindings.

gertvv commented 10 years ago

Perhaps https://github.com/marcoslin/angularAMD can also be of help.

joelkuiper commented 10 years ago

Cool! Although I'm less worried about download size (although we should do a minimize/Closure Compile step in our build process) than I am about the amount of DOM interactions. Especially creating a new scenario is /really/ slow

gertvv commented 10 years ago

Weirdly that seems to be due to the GET $workspace/scenarios -- which should be fast...

gertvv commented 10 years ago

Yes, something is definitely not working correctly on the server side. Probably the connection pooling.

joelkuiper commented 10 years ago

It’s also slow on the localStorage version though

On 15 Jan 2014, at 17:02, Gert van Valkenhoef notifications@github.com wrote:

Yes, something is definitely not working correctly on the server side. Probably the connection pooling.

— Reply to this email directly or view it on GitHub.

gertvv commented 10 years ago

Yes you're right. Initializing the view seems to take upwards of 500ms, which is a bit ridiculous.

The server can also generate some pretty horrid response times, but seemingly only when "cold".

joelkuiper commented 9 years ago

I've started using the angular 1.3 bind-once functionality {{::var}} vs {{var}} and got rid of the old Foundation javascript (in favor of the pure angular directives). This has sped up the client-side a bit. We should still be watching the number of $watchers though, there is a lot going on that doesn't need to be that complicated.

Another thing that has sped up the app a bit is getting rid of the calls to R in the controllers, instead doing them only once when we construct the workspace. This prevents at least one digest cycle.

joelkuiper commented 9 years ago

Switching MathJax to SVG also made sense

joelkuiper commented 9 years ago

We also deferred the angular bootstrap till domReady, this was unnecessary. If you remove the ng-app declaration in HTML you can simply call angular.bootstrap and it will work fine. See https://github.com/drugis/mcda-elicitation-web/blob/develop/app-remote/src/main/webapp/resources/app/js/main.js#L38

This reduces time-to-display quite a bit