Questions tagged as 'desempenho'

3
answers

Performance "where in foreach vs if"

Which of the cases would perform best? var chaves = new list<string>(); foreach(var item in lista) { if(!string.IsNullOrEmpty(item.Chave)) { chaves.Add(item.Chave); } } Or listaValida = lista.Where(x => !string.IsN...
asked by 13.04.2017 / 17:13
5
answers

How to reduce the search time in a table with more than 200 thousand records?

I'm having problems with listing and searching table data with more than 200,000 records. I read in searches, that for the search system, the ideal would be to do indexes of the type "fulltext" in the fields where it will be will have a searc...
asked by 31.08.2017 / 08:59
2
answers

What is a tail recursion?

Nessa question I questioned about performance. One of the users responded that the compiler makes several interesting optimizations, such as inlining , loop unwinding, tail recursion, and caches. How does tail recursion optimization wo...
asked by 16.02.2017 / 11:36
2
answers

Optimize Mysql tables

I work with some huge tables in a system I've developed. These tables are constantly being updated and sometimes the query becomes slow. Some of them have more than 100,000 lines. I would like to know how often I should run the optimization c...
asked by 20.02.2014 / 17:08
2
answers

Better performance for a few hits: HashMap or TreeMap?

I usually use the java.util.HashMap<K,V> structure even for small scopes with very few inputs (up to 50). But I've been wondering if the java.util.TreeMap<K,V> structure would not be better for this situation, taking in...
asked by 25.01.2017 / 16:57
2
answers

Expression-bodied is recommended? Does it have performance differences?

To what extent is it recommended, or even good practice, to use expression-bodied ? I know that expression-bodied allow properties, methods, operators, and other function members to have bodies defined using lambda expressions ( =>...
asked by 20.08.2018 / 20:33
1
answer

SQL Query on Loops is good practice?

Is query set with Where or other sql commands inside loops like Foreach good practice or not recommended at all? Is there a better way to handle the data without having to make so many calls in the database?     
asked by 30.07.2014 / 14:11
1
answer

How to optimize this code?

Is there a faster (performative) way of comparing the current value with the previous value (of the bank) with Entity Framework ? Instead of selecting Id by Id (as Discount property of the code below), check the array...
asked by 18.11.2015 / 20:08
1
answer

What are the differences between the following casts and when to use each one?

   Casting   [...] process where one type of object is explicitly converted to another type, if conversion is allowed. Source: > Stack overflow in Portuguese Assuming the following situation: var i = 10 What are the di...
asked by 09.09.2016 / 00:51
1
answer

Compensates to store the value of a struct member in local variable?

I see several programmers doing this. Instead of accessing the 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 this? Does it matter if the struct...
asked by 09.02.2017 / 13:34