Thread pools on the JVM should usually be divided into the following three categories:
- CPU-bound
- Blocking IO
- Non-blocking IO polling
Each of these categories has a different optimal configuration and usage pattern.
curl -s -XPOST localhost:9200/_bulk?pretty=true --data-binary ' | |
{ "index" : { "_index" : "parent_child", "_type" : "store", "_id" : "store1" } } | |
{ "name" : "auchan", "owner" : "chris" } | |
{ "index" : { "_index" : "parent_child", "_type" : "department", "_id" : "department1", "parent" : "store1" } } | |
{ "name" : "toys", "numberOfProducts" : 150 } | |
{ "index" : { "_index" : "parent_child", "_type" : "product", "_id" : "product1", "parent" : "department1", "routing" : "store1" } } | |
{ "name" : "gun", "trademark" : "tiger", "price" : 9, "store_id" : "store1" } | |
' |
Welcome to Scala version 2.10.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_21). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> import shapeless._ | |
import shapeless._ | |
scala> import syntax.tuple._ | |
import syntax.tuple._ |
/play | |
/*.png | |
/*.bmp | |
/solitaire |
This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).
Matrix multiplication is a mathematical operation that defines the product of
/* | |
* This is a literate quine. That means that | |
* 1. the comments will tell you a little about how it works and | |
* 2. if you compile and run it its output will be identical to its source | |
* code even though it doesn't look at its original source. It literally | |
* contains within itself a complete recipe for how to display itself. | |
* | |
* Quines are ten a penny. This one is unusual because | |
* 1. its main loop consists solely of a loop to print characters | |
* generated by a function called programChar() and |
A traditional table-based DFA implementation looks like this:
uint8_t table[NUM_STATES][256]
uint8_t run(const uint8_t *start, const uint8_t *end, uint8_t state) {
for (const uint8_t *s = start; s != end; s++)
state = table[state][*s];
return state;
}