Questions tagged as 'desempenho'

2
answers

___ ___ erkimt Improves performance - Ruby on Rails ______ qstntxt ___

I have 3 tables:

[users] 1 ----------- n [evaluations] n --------- 1 [items]

Where evaluation can be positive (valuation: true ) or negative (valuation: false ), I need a method that returns all items that the user liked and did not like ... For this I did the following method in the user model:

%pre%

The same principle was adopted for the method for the dislike method

The idea is to do this with many users, the problem is that it is taking a long time to return the data. Is there any way to improve the performance of this code snippet? Any structure that I can keep on the server, because this query is executed many times more than once per user ...

    
______ azszpr28800 ___

I had the idea of trying to do directly in the bank to simplify the process and modified the function to:

%pre%

I've had an improvement of 0.2 seconds in the average ... I'm putting it as an answer because I do not think it will improve more than that, but if someone wants to prove me to the contrary the answer will be very welcome!     

______ azszpr36666 ___

Would not it be less expensive if you paginated? You can use the library link so it will return the paged items I believe will shorten the search time.

    
___

I have 3 tables: [users] 1 ----------- n [evaluations] n --------- 1 [items] Where evaluation can be positive (valuation: true ) or negative (valuation: false ), I need a method that returns all items that the user liked and did not like...
asked by 13.08.2014 / 02:10
1
answer

Performance: switch or if aligned? [closed]

Regardless of language, switch performs better than aligning if s? If yes: why? if ... elif ... elif ... else ... end switch case ... case ... case ... else ... end     
asked by 20.06.2014 / 16:02
1
answer

Save information about execution days

Good afternoon, everyone. I have an automation monitoring system that consumes a table that contains information about n registered automations, about 40 presently. I would however like to make a check on the days on which these automations will...
asked by 15.09.2018 / 17:51
1
answer

I create a table or several tables in SQL Server?

I have tables in my database: Orcamento , Maquinas , Veiculos and Acessorios . I need to record the costs of each of them, for example to each table will be recorded a cost daily I create a table called Custo...
asked by 08.07.2018 / 17:35
1
answer

What is the best method of loading JS files? [closed]

I'm trying to work with the form code that gives me the greatest possible use of what was written, so for every feature I'll need to do in javascript / jQuery I control the individual version of every thing with git. / p> Controlling this indi...
asked by 04.08.2017 / 18:54
1
answer

Is there a problem in the existence of duplicate CSS, but 100% the same?

I have an application, where I have a file called "layout" which is responsible for displaying all HTML (head, footer, body just to call the side menu which is another file) CSS and Javascript common to all pages of this...
asked by 24.03.2017 / 21:13
1
answer

Reboot a variable, or re-create it?

In terms of performance, which is more preferable? Are there other differences between the two modes, other than performance? Reboot a variable multiple times? Private Sub Metodo() Dim MeuTipo As Tipo For i As Integer = 0 To 100...
asked by 20.12.2016 / 22:42
1
answer

Improving script perfomance

Well, I'm doing the following challenge:    The following iterative sequence is defined by the set of integers   positive where:       n - > n / 2 (if n is even) n -> 3n + 1 (if n is odd)       Using the above rules and starting with the...
asked by 28.09.2016 / 04:30
1
answer

Performance for multiple domains on a single server

I have 2 domains pointed to the same server ( Amazon EC2 ) using VirtualHost of Apache . Does this practice interfere with performance and security or will it influence the number of accesses and resources used by the serve...
asked by 03.06.2015 / 20:18
1
answer

Algorithm takes 5sec but the page takes 1.5m to load

After calling a process via ajax if ($('#content-recommendation').length) { $.ajax({ url:'/get_content_recommendation/' + gon.item_id + '.js', type:"get" }); } I do the following in itens_controller/get_content_recommendati...
asked by 23.08.2014 / 16:36