intrinsic memcmp

Note that the repz cmpsb routine might not be faster than glibc’s memcmp. In my tests, in fact, it’s never faster, even when comparing just a few bytes. See

Sort with the limited memory

You are looking for external sorting. The largest cost in these scenarios is often disk IO. So the trick is to use an algorithm that minimises disk IO. The usual approach is to read suitably large chunks in to memory, sort those chunks, saving them back to disk, then merge the sorted chunks. A search … Read more

How to change memory per node for apache spark worker

When using 1.0.0+ and using spark-shell or spark-submit, use the –executor-memory option. E.g. spark-shell –executor-memory 8G … 0.9.0 and under: When you start a job or start the shell change the memory. We had to modify the spark-shell script so that it would carry command line arguments through as arguments for the underlying java application. … Read more

How to assign more memory to Netbeans?

In the etc directory under your Netbeans-Home, edit the file netbeans.conf file. -Xms and -Xmx should be increased to the values that allow your program to compile. Here are the instructions in netbeans.conf: # Note that default -Xmx and -XX:MaxPermSize are selected for you automatically. # You can find these values in var/log/messages.log file in … Read more

How do cache lines work?

If the cache line containing the byte or word you’re loading is not already present in the cache, your CPU will request the 64 bytes that begin at the cache line boundary (the largest address below the one you need that is multiple of 64). Modern PC memory modules transfer 64 bits (8 bytes) at … Read more

What’s the relationship between “a” heap and “the” heap?

Nothing much, to be honest. I would imagine that the word heap was simply taken with it’s everday (non-technical) usage and applied to these two concepts individually as reasonably good analogies. In the first case (tree data structure meaning), the description heap is most appropiate because “greater” objects are placed higher up in the tree … Read more