Questions tagged as 'desempenho'

2
answers

What's the difference between using a comparison with = or simply?

Imagine the following scenario. int i = 2; if(i >= 2) { //.... } When we could simply summarize for; int i = 2; if(i > 1) { //.... } My doubts with these two expressions are as follows: When a low-level language interp...
asked by 01.11.2016 / 15:47
5
answers

Difference between transporting data in JSON and String

I'm finishing building a site in PHP with the MVC architecture, the next step is to integrate the application (which only has the interface) with the core ( controller ) site, to fetch information from the database. data. Thi...
asked by 17.05.2016 / 05:06
3
answers

Query on two tables without INNER JOIN

I wonder, is there a difference in the performance of these two queries? in MySql SELECT employee.*, company.name FROM company, employee WHERE employee.company_id = company.id AND company.id = '365' or SELECT employee.*, company.name F...
asked by 26.03.2014 / 19:43
1
answer

How to analyze performance impact of a code snippet in ADVPL?

I have the following code in ADVPL: Static Function linhaJson(cTabela, cChave, lVerificaExclusao) local cTipo local xResult local cJson := "{" dbSelectArea("ZX1") ZX1->(dbSetOrder(1)) ZX1->(dbGoTop()) ZX1->...
asked by 19.11.2018 / 19:22
3
answers

Which loop is faster in C: while or for?

Being a loop while and a for that rotate the same number of times, which is faster? Example: while : int i = 0; int max = 10; while(i<max){ funcao(); i++; } for : int i; int max = 10; for(i=0; i<...
asked by 10.12.2015 / 19:00
1
answer

How can you check if the number in range is so fast?

It is known that with the module timeit it is possible to measure, in Python, the execution of code snippets. Curious, I've been testing how long it takes to see if a given number is in a range defined by range , such as x in r...
asked by 17.04.2018 / 03:53
3
answers

What is the cost of calling many functions?

Recently, in the face of a discussion on Clean Code and best programming practices, a co-worker commented that in his previous job there was a lot of resistance from other programmers to begin dividing code and make it more readable. The mai...
asked by 15.02.2017 / 20:29
2
answers

Which one performs better? For or Foreach + Range?

In the two ways below, which one performs better? For : for( $x=1; $x < 31; $x++ ) echo $x . PHP_EOL; Foreach + range : foreach( range(1,30) as $x ) echo $x . PHP_EOL; I know the difference will proba...
asked by 08.05.2015 / 21:03
2
answers

Performance difference between several conditions in an IF or multiple IF's separately?

During a change in a source code, I came across the following situation, developed by another developer: if ( booleano1 || booleano2 || booleano3 ) { if( booleano1 ) { //faz algo } if( booleano2 ) { //faz a...
asked by 03.12.2015 / 12:54
1
answer

RamDrive with video card ram

I use the R language for heavy matrix calculations. I'm using gpu for performance gain, which is fantastic indeed. However, I would like to take another step and dump the 2gb matrix of data directly into the ram of the video card Or maybe,...
asked by 03.04.2015 / 01:40