This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/time.h> | |
#include "roaring.c" | |
int main() { | |
size_t bitmapcount = 2; | |
size_t size = 1000000; | |
struct timeval st, et; |
This file contains 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
// | |
// $ g++ -O3 -o cachetest cachetest.cpp | |
// $ ./cachetest | |
// cycles = 349189333 (cycles per key 34.919) instructions = 190000063 (ins/key 19.000,ins/cycles 0.544) cache misses = 17385995 (misses per keys 1.739) branch misses = 6 (misses per keys 0.000) | |
// | |
// start helper header | |
// https://github.com/WojciechMula/toys/blob/master/000helpers/linux-perf-events.h | |
#ifdef __linux__ | |
#include <asm/unistd.h> // for __NR_perf_event_open |
This file contains 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
.section __TEXT,__text,regular,pure_instructions | |
.macosx_version_min 10, 13 | |
.section __TEXT,__literal16,16byte_literals | |
.p2align 4 ## -- Begin function _Z9timestampv | |
LCPI0_0: | |
.long 1127219200 ## 0x43300000 | |
.long 1160773632 ## 0x45300000 | |
.long 0 ## 0x0 | |
.long 0 ## 0x0 | |
LCPI0_1: |
This file contains 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
import sys | |
depth = int(sys.argv[1]) | |
s="" | |
for j in range(depth): | |
s+="[" | |
s+="true" | |
for j in range(depth): | |
s+="]" | |
print(s) |
This file contains 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
rawdata = [["age","workclass","capital_loss"],["age","capital_gain","capital_loss"],["age","workclass","capital_loss","x"],["age","capital_gain","capital_loss","x"],["workclass","hours_per_week","native_country"],["age","capital_loss","native_country"],["workclass","hours_per_week","native_country","x"],["age","capital_loss","native_country","x"],["age","capital_loss","x"],["age","capital_gain","native_country"],["age","workclass","capital_gain"],["age","workclass","capital_gain","x"],["age","capital_gain","native_country","x"],["age","capital_gain","x"]] | |
print("how many sets", len(rawdata)) | |
sdata = map(set,rawdata) | |
#print(len(sdata)) | |
total = len(sdata) | |
allkeys = reduce(lambda x,y :x.union(y),sdata) | |
print("how many attributes ", len(allkeys)) | |
l = set() | |
d = [] |
This file contains 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
/*** | |
result: | |
152ca78d | |
027c6003 | |
cb07bbf3 | |
f98befee | |
1cd777e3 | |
a4e29590 | |
661e4b6d |
This file contains 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
import org.roaringbitmap.*; | |
import java.io.*; | |
import java.util.*; | |
public class Basic { | |
public static void main(String[] args) throws IOException { | |
DataInputStream in; | |
in = new DataInputStream(new FileInputStream(args[0])); |
This file contains 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
import org.roaringbitmap.RoaringBitmap; | |
import org.roaringbitmap.buffer.*; | |
import java.io.*; | |
import java.nio.*; | |
public class Issue319 { | |
This file contains 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
// with jemalloc | |
$ strace ./lemirebenchmark | |
execve("./lemirebenchmark", ["./lemirebenchmark"], [/* 28 vars */]) = 0 | |
brk(NULL) = 0x79d0000 | |
openat(AT_FDCWD, "/usr/local/lib/libjemalloc.so.2", O_RDONLY|O_CLOEXEC) = 3 | |
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0\340b\0\0\0\0\0\0"..., 832) = 832 | |
fstat(3, {st_mode=S_IFREG|0755, st_size=4887824, ...}) = 0 | |
mmap(NULL, 1113224, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xffffaa020000 | |
mmap(0xffffaa090000, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x60000) = 0xffffaa090000 |
This file contains 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
// with jemalloc | |
$ strace ./lemirebenchmark | |
execve("./lemirebenchmark", ["./lemirebenchmark"], [/* 28 vars */]) = 0 | |
brk(NULL) = 0x79d0000 | |
openat(AT_FDCWD, "/usr/local/lib/libjemalloc.so.2", O_RDONLY|O_CLOEXEC) = 3 | |
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0\340b\0\0\0\0\0\0"..., 832) = 832 | |
fstat(3, {st_mode=S_IFREG|0755, st_size=4887824, ...}) = 0 | |
mmap(NULL, 1113224, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xffffaa020000 | |
mmap(0xffffaa090000, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x60000) = 0xffffaa090000 |