diff --git a/ufovectors/benchmark/create_binary_files.sh b/ufovectors/benchmark/create_binary_files.sh deleted file mode 100755 index 2473772..0000000 --- a/ufovectors/benchmark/create_binary_files.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -head -c 400000 /dev/urandom > 100Kints.bin -head -c 2000000 /dev/urandom > 500Kints.bin - -head -c 4000000 /dev/urandom > 1Mints.bin -head -c 64000000 /dev/urandom > 16Mints.bin -head -c 128000000 /dev/urandom > 32Mints.bin -head -c 256000000 /dev/urandom > 64Mints.bin -head -c 512000000 /dev/urandom > 128Mints.bin -#head -c 1024000000 /dev/urandom > 256Mints.bin -#head -c 2048000000 /dev/urandom > 512Mints.bin -head -c 4096000000 /dev/urandom > 1024Mints.bin \ No newline at end of file diff --git a/ufovectors/benchmark/matrix.R b/ufovectors/benchmark/matrix.R deleted file mode 100644 index 4032f6d..0000000 --- a/ufovectors/benchmark/matrix.R +++ /dev/null @@ -1,23 +0,0 @@ -#devtools::install_github("olafmersmann/microbenchmarkCore") -#devtools::install_github("olafmersmann/microbenchmark") - -library(microbenchmark) -library(ggplot2) - -library(ufovectors) -library(ufoaltrep) - -setwd("~/Workspace/ufo_workspace/UFOs/ufovectors/benchmark") - -result <- microbenchmark( - "UFO" = { - sum(ufo_integer_bin("32Mints.bin")) - }, - "ALTREP" = { - sum(altrep_ufo_integer_bin("32Mints.bin")) - }, - times = 10L -) -#ufo_shutdown() - -autoplot(result) \ No newline at end of file diff --git a/ufovectors/data/gen.c b/ufovectors/data/gen.c new file mode 100644 index 0000000..78ecc00 --- /dev/null +++ b/ufovectors/data/gen.c @@ -0,0 +1,20 @@ +#include +#include +#include + +int main (int argc,char *argv[]) { + if (argc != 4) { + printf("usage: gen FILE N_ITEMS VALUE"); + exit(1); + } + + char *path = argv[1]; + size_t n = atoi(argv[2]); + uint32_t v = atoi(argv[3]); + + FILE *fp = fopen(path, "w"); + for (size_t i = 0; i < n; i++) { + fwrite(&v, sizeof(uint32_t), 1, fp); + } + fclose(fp); +} diff --git a/ufovectors/data/gen.sh b/ufovectors/data/gen.sh new file mode 100755 index 0000000..d97b8f6 --- /dev/null +++ b/ufovectors/data/gen.sh @@ -0,0 +1,13 @@ +#!/bin/bash +[ ! -e "gen" ] && (gcc -o gen gen.c) + +if [ $# -ne 3 ] +then + echo "usage: gen.sh FILE N_ITEMS VALUE" + exit 1 +fi + +case "$3" in + random) head -c $((4 * $2)) /dev/urandom > "$1";; + *) ./gen "$1" "$2" "$3";; +esac diff --git a/ufovectors/data/generate_examples.sh b/ufovectors/data/generate_examples.sh new file mode 100755 index 0000000..08963ba --- /dev/null +++ b/ufovectors/data/generate_examples.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +function generate_both { + echo "generating ${1}_rand_int.bin" + ./gen "${1}_rand_int.bin" $2 random + + echo "generating ${1}_ones_int.bin" + ./gen "${1}_ones_int.bin" $2 1 +} + +function generate_ones { + echo "generating ${1}_ones_int.bin" + ./gen "${1}_ones_int.bin" $2 1 +} + +# T G M K 1 +generate_both 1K 1000 # 3.9 KB +generate_both 100K 100000 # 392 KB +generate_both 1M 1000000 # 3.8 MB +generate_both 10M 10000000 # 38 MB +generate_both 100M 100000000 # 381 MB +generate_ones 1G 1000000000 # 3.7 GB +# T G M K 1 + +