This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess; | |
| #ifndef XXH_CPU_LITTLE_ENDIAN // It is possible to define XXH_CPU_LITTLE_ENDIAN externally, for example using a compiler switch | |
| static const int one = 1; | |
| # define XXH_CPU_LITTLE_ENDIAN (*(char*)(&one)) | |
| #endif | |
| usage: | |
| XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; | |
| taken from https://github.com/Cyan4973/xxHash/blob/master/xxhash.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| # This script expects /proc/zone_info file as input. | |
| # $ perl calc-reclamation-watermarks.pl < /proc/zoneinfo | |
| # The output should look something like the following: | |
| # pagesize: 4096 | |
| # | |
| # node 0 high: 449.76 MB 471605248 bytes 115138 pages | |
| # node 0 low: 374.80 MB 393003008 bytes 95948 pages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "unsafe" | |
| "reflect" | |
| ) | |
| func main() { | |
| arr := make([]interface{}, 10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "unsafe" | |
| "reflect" | |
| ) | |
| func main() { | |
| var arr [10]string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| perl redis_fork_vs_anyevent.pl 10000 100 | |
| N: 10000, DATA LENGTH: 100 | |
| s/iter fork anyevent_redis anyevent_hiredis | |
| fork 8.37 -- -26% -91% | |
| anyevent_redis 6.19 35% -- -87% | |
| anyevent_hiredis 0.780 974% 693% -- | |
| N: 1000, DATA LENGTH: 1000 | |
| Rate fork anyevent_redis anyevent_hiredis | |
| fork 1.28/s -- -59% -94% |