I'm looking at the woothash hash function, a reiteration of wyhash - one of the best hash functions all-around according to the SMHasher project. Bot ...
I'm looking at the woothash hash function, a reiteration of wyhash - one of the best hash functions all-around according to the SMHasher project. Bot ...
Suppose in every instance of DataProcessor, the do_something_special flag supplied is always the same (i.e. we only pass in false on special occasio ...
For context this question is related to the blog post on Cache Processor Effects, specifically Example 1-2. In the code snippet below, I'm increasing ...
I wrote a simple for loop in Delphi and translated it to Julia. The execution time of the Delphi program, compared with the Julia one, is just patheti ...
I made the experience (this is not the question but a statement), that avoiding non-constant local variables in favor of const variables or avoiding l ...
Looking for this code: #include <stdint.h> extern struct __attribute__((packed)) { uint8_t size; uint8_t pad; uint16_t sec_num; ...
Consider this C++ code: GCC with -fwrapv correctly realizes that subtracting 1 from b can eliminate the special case, and it generates this code fo ...
Recently, I had a debate with a colleague about comparing python vs C++ in terms of performance. Both of us were using these languages for linear alge ...
For x86-64 there are lots of instruction sets that speed up code execution. Here is a list from gcc wiki https://gcc.gnu.org/wiki/FunctionMultiVersion ...
Consider this code When compiling in clang++ -O0, it compiles in seconds and then run for 4 seconds. However, with clang++ -O2, compiling takes a ...
I don't know if there is a good and clean way to index variadic arguments when unpacking tuple-like objects into callable handlers, i.e. when using st ...
Given the following tiny program: I noticed that each of the next# statements get compiled as TWO instructions. I would have expected this to on ...
Example: https://www.godbolt.org/z/ahfcaj7W8 From https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Optimize-Options.html It says -ftree-loop-vector ...
This is more of a theoretical question. I'm familiar with how padding and trailing padding works. There needs to be padding after x, so that *p is ...
I am working on a library to read Serial data from an electric counter. The counter can transmit up to 105 different tags depending on your contract. ...
Translate the following code it into machine code and show the register and address descriptors while the instructions are generated. (Assume that two ...
I have these two source files: const ARR_LEN: usize = 128 * 1024; pub fn plain_mod_test(x: &[u64; ARR_LEN], m: u64, result: &mut [u64; ARR_L ...
I have a program that makes heavy use of the intrinsic command _BitScanForward / _BitScanForward64 (aka count trailing zeros, TZCNT, CTZ). I would lik ...
I'm using gcc 12.2 on linux. I use -nostdlib and the compiler complained about lack of memcpy and memmove. So I implemented a bad memcpy in assembly a ...
I have a project written in C++, and the platform to be deployed in has a limitation of 256KB of binary size. The toolchain is wasi-sdk-16.0 clang++, ...