Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 24084

Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.

2 votes
Accepted

check_prime.cpp (checks if input is a prime number)

Formatting: Indent your code consistently. This makes it easier to understand and spot errors. Also, it attracts people here to read it at all. Your's is not a mess, but inconsistent still. Another r …
uli's user avatar
  • 1,705
1 vote

My code for a LocalBinaryPatern in python is running very slow. Any tips?

No else after return You have code like if x: return 0 else: ... Just drop the else, because you previously already returned. Use else branches only if the code converges again after the two …
uli's user avatar
  • 1,705
5 votes

Remove all unwanted characters from a string buffer, in-place

Error Handling If strdup() fails, your function fails but it doesn't signal failure in any way. To me, that's a complete no-go, because that means that you can't guarantee anything! In this case, the …
uli's user avatar
  • 1,705
3 votes

XOR two files together

Concerning your question what performance to expect, my gut feeling is similar to yours, that 4s is too long. However, this depends a lot on the computer you use. …
uli's user avatar
  • 1,705
9 votes

Chess engine for C++

Since you want performance and that is often tied to memory use, consider using uint8_t, which should be large enough. There is also an according enumeration named pieceColor. … For a plain array, the indirection via the pointer is skipped, which improves performance. Using the std::array wrapper, you still get things like iterators, size() methods etc. …
uli's user avatar
  • 1,705
5 votes

Count frequency of words and print them in sorted order

The code looks clean and structured. It's something I'd enjoy working with, so this is fine. Of course, there are a few things that could be changed, so let's dive into these... Cleanup On Termination …
uli's user avatar
  • 1,705
0 votes
Accepted

Trying to get every 6th set of 4 bytes from a python array

Your formatting is bad, adhere to PEP8 for readability. j is always n * 24, so you could eliminate one of them. I'd probably use j exclusively. Instead of manually iterating an integer in a while loo …
uli's user avatar
  • 1,705
5 votes

Reverse Engineering Data Files (Binary Visualization)

Performance When processing a file, you toggle between CPU bound and IO bound. First, your CPU sits there, waiting for a chunk of data to be read. … On a similar note, it could be that using multiple threads to process the data would improve performance even more. …
uli's user avatar
  • 1,705