Many mainframes - performance issues?

tl; dr: I wonder if it is too heavy or not the presence of a large number (100+ at the moment, maybe up to 1000/2000 or more) of the baseline representations (like table cells)>

The project I'm working on revolves around planning. There one row per user, which covers 6 hours a day, is divided into 4 slots of 15 million every hour. This planning is used to add “reservations” when clicking on the slot and should handle the hanging of the correct slots, and also process when it is impossible to make a reservation, those. do not allow the user to click on the "inaccessible" slot.

There are many reasons why you can’t click the slot: the user is currently unavailable or the user is on a reservation; or the application must “force” a delay between the two reservations. Reservations (div) are displayed in the slot (table cell), and when playing with dimensions, the correct number of slots is induced.

This entire screen is processed using the trunk. Therefore, for each slot on which I am hovering, I need to check whether I can make a reservation here or not. At the moment, I use this when playing with data attributes in slots: when adding a reservation object, slots covered with "improved" (among others) reservation object (viewing object of the main area).

But in some cases, I don’t quite understand now, it mixes up, and when the kind of reservation is deleted, the slots do not “clear”: the previous class does not match reset correctly, This is probably what I did wrong or bad, but it will only be harder; I think I should use a different class of Backbone views here, but I'm afraid that the number of slots and their views will be high and cause performance problems. I do not know what js perf is, so I would like to get feedback before jumping on this train. Any other tips on how to do this would also be welcome.

Thank you for your time. If this is not clear enough, tell me, I will try and rephrase it.

+6
source share
3 answers

We have a pretty complicated backbone.js application with potentially thousands of views at a given time. Our bottlenecks are mainly associated with memory leaks from views that were not properly removed or eventdriven, which renders viewing visuals unnecessary. However, the actual number of views seems to have little effect. The backbone performances are fairly light, so as long as you do not have too many events associated with them, this is not so important.

You may run into performance issues, but apparently this is not a problem.

What you can do though, if you use thousands of views, you need to pin the initial rendering into one big ".html ()" call. You can do this by providing each element of the form id based on the cid of the view, and then combine the html lines of the view, and then you use setElement on each view to find its element again.

+7
source

Maybe this helps a little:
fooobar.com/questions/921781 / ...

btw: i like your avatar;)

+2
source

Database management is all the least effective way for a browser. If this is not fast enough, you need to stop creating and destroying templates. Caching a template almost does not help.

Instead of calling the render function against, save the variable in the jquery selector, and when the model changes use the cache selector to update the DOM. This will give you the greatest leap in performance with the bat.

 $title = null, init = function(){ $title = this.$el.find('h1'); }, onTitleChange = function(event){ $title.html(event.value) } 

I am working on a representation of the spine. It can display a collection with 1,000,000 models at 120FPS. The code runs on Github. https://github.com/puppybits/BackboneJS-PerfView There are many other optimizations you can do. If you check PrefView, it has comments on most optimizations.

0
source

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


All Articles