Knockout notifySubscribers + Durandal = rapidly declining performance?

I have created an application using DurandalJS, although I do not know if the structure is suitable. In Firefox and Chrome, if I click on the blue fields (folders), performance degrades quickly, and I'm not sure why. Each new folder that I click on takes a longer time to open it - I see that this happens after opening 20-30 folders.

These folders are not cached and should be based on a singleton viewModel:

define(['services/dataservice', 'durandal/plugins/router', 'durandal/app', 'services/hub', 'viewmodels/setVm', 'viewmodels/folderVm'], function (dataservice, router, app, hub, SetViewModel, FolderViewModel) { // define vm return vm; } 

In the FF profiler, I see something like this:

enter image description here

I'm not sure if this makes sense to those of you who are more familiar with profiling, but I can't understand for life why this performance degradation will occur.

The memory profile in chrome shows a maximum memory consumption of about 45 MB, but the time I have to wait for the page to draw is getting worse.

The live site is here:

www.nogginator.com

Any idea why this will happen?

+4
source share
1 answer

Thus, the problem ended up with too many things being in shell view mode, stopping garbage collection from its recovery. Dividing it into several parts had a significant impact on productivity.

Shell was divided into

  • A authentication
  • A sidebar viewmodel
  • A menu viewmodel
  • Configuration of some routers
+6
source

Source: https://habr.com/ru/post/1496337/


All Articles