Top "Performance" questions

For questions pertaining to the measurement or improvement of code and application efficiency.

Which "href" value should I use for JavaScript links, "#" or "javascript:void(0)"?

The following are two methods of building a link that has the sole purpose of running JavaScript code. Which is …

javascript html performance optimization href
Fastest way to check if a value exists in a list

What is the fastest way to know if a value exists in a list (a list with millions of values …

python performance list
How to measure elapsed time in Python?

What I want is to start counting time somewhere in my code and then get the passed time, to measure …

python performance measure timeit
Why is processing a sorted array faster than processing an unsorted array?

Here is a piece of C++ code that shows some very peculiar behavior. For some strange reason, sorting the data …

java c++ performance optimization branch-prediction
How can I read a large text file line by line using Java?

I need to read a large text file of around 5-6 GB line by line using Java. How can I …

java performance file-io io garbage-collection
LIKE vs CONTAINS on SQL Server

Which one of the following queries is faster (LIKE vs CONTAINS)? SELECT * FROM table WHERE Column LIKE '%test%'; …

sql-server performance contains sql-like
Why is the Android emulator so slow? How can we speed up the Android emulator?

I have got a 2.67  GHz Celeron processor, and 1.21  GB of RAM on a x86 Windows XP Professional machine. My understanding …

android performance android-emulator genymotion qemu
String formatting: % vs. .format vs. string literal

Python 2.6 introduced the str.format() method with a slightly different syntax from the existing % operator. Which is better and for …

python performance logging string-formatting f-string
Convert Set to List without creating new List

I am using this code to convert a Set to a List: Map<String, List<String>> …

java performance list set
How does database indexing work?

Given that indexing is so important as your data set increases in size, can someone explain how indexing works at …

sql database performance indexing database-indexes