Most voted "performance" questions
For questions involving measurement and improvement of code efficiency
Learn more…479 questions
Sort by count of
-
6
votes4
answers829
viewsBest approach is to filter data in the database or application?
Suppose we have a table 'Vendas' with the following columns 'estado', 'cidade', 'vendedor', 'valor'. 'estado' and the 'cidade' would be where the sale was held and 'vendedor' would be what made this…
-
6
votes3
answers247
viewsConcatenation or data sequencing: which performs best?
A few days ago I was writing some articles about PHP, in which I was asked about a possible performance improvement in large Scale when developing PHP applications. The assumption was as follows::…
-
6
votes1
answer499
viewsCOUNT(*) x COUNT(1) x COUNT(id)
I would like to understand better about the difference between these ways of using the counter: select COUNT(*) from tabela select COUNT(1) from tabela select COUNT(id) from tabela This question…
-
6
votes1
answer85
viewsShould I avoid operations between constants in a loop?
In C++ there is some sort of optimization or cache that prevents the same mathematical operation between constants to be repeated, mainly in loops, thus decreasing application performance? For…
-
6
votes2
answers112
viewsWhen is an Slice data copied?
When I do so: a = [ 1, 2, 3] b = a[1:] b use the same list of a or it creates another list and copies the data that is pertinent? If you have many items it will slow down? Happens even if I don’t…
-
6
votes1
answer68
viewsAre Java enumerations anti-performance?
In a project I thought of exchanging whole ones for enumbut a colleague told me that enums are anti performatic.
-
6
votes1
answer196
viewsWhat is the difference between performance between different types of string concatenation?
I know 4 different types of concatenation of string in the c#: // string Interpolation $"valor {variavel} R$"; // Verbating string @"texto qualquer pula a linha e continua o texto"; // concatenar 2…
-
6
votes1
answer124
viewsWhy is the "in" method for checking if an element belongs to a collection so slow?
I was having a lot of difficulty executing code efficiently and found that the problem was on a line that used the operator in. Then I created a new function that searches for a match in the list of…
-
5
votes9
answers2644
viewsBest practice for creating if
Which of the two code options has better performance? I’m going to show you a very simple example, usually there’s more code inside the if. To) string mensagem = "OI"; if(exibirAdeus) mensagem =…
-
5
votes4
answers4278
viewsMysql performance with Innodb in large data mass table
I currently have a table with about 6 million records that in turn perform a large amount of I/O operations, so in the design of the project I chose to use the Innodb instead of Myisam in Mysql,…
-
5
votes2
answers188
viewsC# Difference between Beginaccept and Acceptasync
What is the difference between the two asynchronous forms? Which has better performance handling sockets and handling thousands of connection simultaneously? Example for Beginxxx:…
-
5
votes1
answer805
viewsHow to simulate concurrent traffic/access arbitrarily in Apache?
I am using Easyphp 14.1 Devserver, which comes with`Apache 2.4.7/Mysql 5.6.15. I am willing to simulate high traffic and concurrent access to observe the performance and behavior of my site under…
-
5
votes1
answer723
viewsProblem loading image in HTML (Performance)
While the entire DOM parser process is blocked, this prevents the rendering of the rest of the page. And this if applied to each page script tag. A way that I found to "circumvent" this problem was…
-
5
votes1
answer1284
viewsphp vs nodejs performance on websockets server
What I take for granted at the moment is that nodejs is more suitable to work with a constant pool of socket connections (websockets in this case) because being single-threaded each new connection…
-
5
votes1
answer1177
viewsSpeed difference in HD Sata/SSD
I have Mongodb running on a 500GB SSD HD. But as the folder /date started to get too big, we put a HD slave 3TB, but this being SATA and not SSD as the first. But after changing the date folder to…
-
5
votes1
answer923
viewsTips to improve the performance of an ASP.NET MVC site
I attended Devday 2015 and had the opportunity to participate in the Roberta Arcoverde about the architecture of Stackoverflow. I found her approach on the issue of performance interesting,…
-
5
votes2
answers1014
viewsHow can we get the execution time of a script?
You’re reading the question here Compared to Datetime class, the date function is more performative? and did some tests with the answer by Daniel Omine, but I got results that didn’t seem at all…
-
5
votes2
answers1524
viewsCondition on Join or Where?
Is there any difference if I use: select * from a left join b on a.id = b.id and b.id2=1 where ... or select * from a left join b on a.id = b.id where b.id2=1 Sent on: Fri ? The first SQL returned…
-
5
votes1
answer195
viewsWhat are the differences between the following Caps and when to use each one?
Casting [...] process where an object type is explicitly converted to another type, if conversion is allowed. Source: Stackoverflow in Portuguese Assuming the following situation: var i = 10 What…
-
5
votes1
answer69
viewsDoes using multiple namespaces weigh more?
Let’s say I have these namespaces: use DataTables\Editor, DataTables\Editor\Field; DataTables\Editor\Format, DataTables\Editor\Mjoin, DataTables\Editor\Options, DataTables\Editor\Upload,…
-
5
votes2
answers572
viewsDifference between Compact function and literal array assignment
According to the PHP documentation, the function compact. For each of the parameters passed, compact() looks for a variable with the name specified in the symbol table and adds it in the output…
-
5
votes1
answer121
viewsPerformance difference from for simple and for iterator
I have a list of customers and on a certain screen the user can do a search and edit the clients of the list that is quite extensive, comparing these two examples which would be the best to work?…
-
5
votes1
answer259
viewsWhy not iterate a hashmap?
I was doing a project and one of my colleagues mentioned that iterate hashmaps is something to avoid and instead of using hashmap should wear Linked lists. However I think the versatility of the…
-
5
votes1
answer415
viewsTemporary variable performance within loop
During college a professor commented with me that declare a variable before a loop and reuse it was an economic and more interesting way to do it. For example (in Java): String str; for(Pessoa p :…
-
5
votes4
answers146
viewsPerforming functions with and without creating local variables
Despite the simplicity of this question, I could not find an answer to it on the Internet. Is there any structural/performance difference between the two functions defined below? def F(x): Output =…
-
5
votes1
answer100
viewsAmount of index influence on performance?
I have a relatively large database. And the consultation in it varies a lot and I have some doubts regarding performance: 1- Create multiple indexes, taking into account the Where (E.condicao = '1')…
-
5
votes1
answer129
viewsDifferent regex strategies to get the same result
I have the following input: Detalhamento de Serviços nº: 999-99999-9999 I need to get the number in a group, for that I would use: Detalhamento de Serviços nº: (\d+-\d+-\d+) However I can’t trust…
-
5
votes2
answers111
viewsShould I avoid repeated access to the same method within a loop?
I worry about the final performance of an executable, at the same time I don’t want to penalize the programmer with excessive or unnecessary care in the code. In the code below, for example, it will…
-
5
votes2
answers147
viewsIn Java because (250 >> 4) is more optimized than (250 / 16)
I’m taking a Java course and in a class the teacher said that this code: int xstart = Camera.x >> 4; int ystart = Camera.y >> 4; is more "fast or optimized" than this code: int xstart =…
-
5
votes1
answer98
viewsDoubt when designing a database
What is the best way to design a database for a web system, for example, this system is for doctors, and every doctor has his or her schedule, patients, cashier, etc. What would be better: A single…
-
5
votes2
answers64
viewsIs expression-bodied recommended? Is there a performance difference?
The extent to which it is recommended, or even good practice to use Expression-bodied? I know that the Expression-bodied allow properties, methods, operators and other function members to have…
-
5
votes2
answers156
viewsWhat is the correct way to do an Replace in a string-like variable?
I need to create a folder on the file server and realized that the variable that receives one of the information is coming with invalid characters ( / : * ? " < > |) for creating a folder on…
-
4
votes2
answers6308
viewsOptimize Mysql tables
I work with some huge tables in a system I developed. These tables are constantly being updated and sometimes the query becomes slow. Some of them even have more than 100,000 lines. I would like to…
-
4
votes2
answers142
viewsGenerate final HTML in PHP or JS?
What is the best way, the best performance, to generate the final HTML. Direct in server-side or receive the database data and generate the HTML in client-side? In the development of my current…
-
4
votes2
answers1134
viewsIs there a performance gain when using View’s in SQL?
As View's are virtual tables resulting from consultations SQL, as in the example: CREATE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition From this, we can update or delete a…
-
4
votes1
answer826
viewsIs SQL Query in Loops a good practice?
Ride query with Where or other sql commands within loops like Foreach is it a good practice or not recommended at all? There is a better way to treat the data without having to make so many calls in…
-
4
votes2
answers508
viewsWhen is it recommended to use decreasing indexes?
For default, relational databases create indices using increasingly ordered binary tree structures. But there is the possibility of creating it in a decreasing way too. My question is whether (and…
-
4
votes2
answers141
viewsDisplaying massive amount of data
From the moment we work with a very large amount of data(eg: more than 3 million records), and we need to display this data on the screen while the user uses the page, always having the best…
-
4
votes1
answer333
viewsPerformance in Mysql Database Queries
What is the best option in terms of performance? I do select * from agenda, paciente where agenda.id_paciente = paciente.id_paciente and take the data together from the agenda and patient or do…
-
4
votes1
answer84
viewsJava class for performance analysis of my project
I’m looking for a Java class or bundle to help me analyze the performance of my app. I need information such as: processing time, memory consumption, processor usage ... and so on. I know there are…
-
4
votes1
answer580
viewsHigh memory consumption Java Swing application
I am developing a Java application but when performing some tests and noticed that when running the application, my memory consumption increases. And as the use, it always allocates more and more…
-
4
votes2
answers53
viewsDoes using Alternative Syntax change performance?
Use the Alternative syntax for control structures brings huge changes in the amount of code lines of a project, but there is some change in security?…
-
4
votes1
answer137
viewsPerformance CSS (CSSOM and selectors)
Considering the assembly of CSSOM by the browser and parser (read) given right to left. I would like to play a question, because I was writing a css in a project and always have with me for…
-
4
votes1
answer264
viewsPerformance difference between static and shared library
Which is the best performance? Compile the program using libraries such as Mysql Connector and Sqlite as Static (staying inside the compiled binary) or as Shared being separated from binary. In…
-
4
votes1
answer114
viewsHow to optimize this code?
Is there any faster (performative) way to compare the current value with the previous (bank) value with Entity Framework? Instead of selecting Id for Id (according to property Discount code below),…
-
4
votes2
answers223
viewsIs there a performance difference between Tuple and List?
In Python, I know there’s a difference between Tuple and a List. To Tuple is immutable, and the List, mutable. You even have that question here: What is the main difference between a Tuple and a…
-
4
votes2
answers117
viewsCan separating static methods into several classes have a negative impact?
In question of organization it is relevant to separate methods into different classes. If we organize the methods in different classes in order to create a better organization, we can have a…
-
4
votes1
answer97
viewsDoes it pay to store the value of a struct member in a local variable?
I see several programmers doing this. Instead of accessing a member of a struct directly, it copies the value to a local variable to the function and uses this variable. Is there performance gain in…
-
4
votes2
answers310
viewsWhich object performs best? Sqldatasource or Datatable?
In terms of performance, speed, or even safety, what is the best object to be used as a DataSource? Example, I’m creating a DataSource, to popular a GridView: For SqlDataSource:…
-
4
votes2
answers230
viewsDirect cast or cast functions. What is the best option?
In PHP, I realize that it is possible to do some things in countless ways. One of them that comes to my attention is the functions and functionalities related to the conversion of types. It is…