Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
4cac8a107f | |||
7cf70edd39 | |||
0be9c9b53e | |||
f8ef807af6 | |||
7e1f7fa3ea | |||
1a60faf70e | |||
9c4ab3e8ef |
3
Makefile
3
Makefile
@ -25,9 +25,6 @@ release:
|
||||
doc:
|
||||
crystal docs src/dodb.cr
|
||||
|
||||
high-volume-db:
|
||||
$(Q)crystal build spec/high-volume-db.cr $(OPTS) --release
|
||||
|
||||
HTTPD_ACCESS_LOGS ?= /tmp/access-dodb-docs.log
|
||||
HTTPD_ADDR ?= 127.0.0.1
|
||||
HTTPD_PORT ?= 9000
|
||||
|
16
bin/extract-data-benchmark-cars.sh
Executable file
16
bin/extract-data-benchmark-cars.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
if [ $# -ne 1 ]
|
||||
then
|
||||
echo "usage: $0 result-directory"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
d=$1
|
||||
|
||||
awk '{ print $1 }' < $d/ram_index.d | sort -n | uniq > it
|
||||
mkdir data
|
||||
|
||||
echo "from truncated data (.t) to graphed data data/XXX.d"
|
||||
paste it $d/ram_index.t $d/cached_index.t $d/fifo_index.t $d/semi_index.t $d/uncached_index.t > ./data/index.d
|
||||
paste it $d/ram_partitions.t $d/cached_partitions.t $d/fifo_partitions.t $d/semi_partitions.t $d/uncached_partitions.t > ./data/partitions.d
|
||||
paste it $d/ram_tags.t $d/cached_tags.t $d/fifo_tags.t $d/semi_tags.t $d/uncached_tags.t > ./data/tags.d
|
286
bin/ghighlight
Executable file
286
bin/ghighlight
Executable file
@ -0,0 +1,286 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
# ghighlight - A simple preprocessor for adding code highlighting in a groff file
|
||||
|
||||
# Copyright (C) 2014-2018 Free Software Foundation, Inc.
|
||||
|
||||
# Written by Bernd Warken <groff-bernd.warken-72@web.de>.
|
||||
|
||||
my $version = '0.9.0';
|
||||
|
||||
# This file is part of 'ghighlight', which is part of 'groff'.
|
||||
|
||||
# 'groff' is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# 'groff' is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
|
||||
# You can find a copy of the GNU General Public License in the internet
|
||||
# at <http://www.gnu.org/licenses/gpl-2.0.html>.
|
||||
|
||||
########################################################################
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
#use diagnostics;
|
||||
|
||||
# current working directory
|
||||
use Cwd;
|
||||
|
||||
# $Bin is the directory where this script is located
|
||||
use FindBin;
|
||||
|
||||
# open3 for a bidirectional communication with a child process
|
||||
use IPC::Open3;
|
||||
|
||||
|
||||
########################################################################
|
||||
# system variables and exported variables
|
||||
########################################################################
|
||||
|
||||
$\ = "\n"; # final part for print command
|
||||
|
||||
########################################################################
|
||||
# read-only variables with double-@ construct
|
||||
########################################################################
|
||||
|
||||
our $File_split_env_sh;
|
||||
our $File_version_sh;
|
||||
our $Groff_Version;
|
||||
|
||||
my $before_make; # script before run of 'make'
|
||||
{
|
||||
my $at = '@';
|
||||
$before_make = 1 if '@VERSION@' eq "${at}VERSION${at}";
|
||||
}
|
||||
|
||||
my %at_at;
|
||||
my $file_perl_test_pl;
|
||||
my $groffer_libdir;
|
||||
|
||||
if ($before_make) {
|
||||
my $highlight_source_dir = $FindBin::Bin;
|
||||
$at_at{'BINDIR'} = $highlight_source_dir;
|
||||
$at_at{'G'} = '';
|
||||
} else {
|
||||
$at_at{'BINDIR'} = '@BINDIR@';
|
||||
$at_at{'G'} = '@g@';
|
||||
}
|
||||
|
||||
|
||||
########################################################################
|
||||
# options
|
||||
########################################################################
|
||||
|
||||
foreach (@ARGV) {
|
||||
if ( /^(-h|--h|--he|--hel|--help)$/ ) {
|
||||
print q(Usage for the 'ghighlight' program:);
|
||||
print 'ghighlight [-] [--] [filespec...] normal file name arguments';
|
||||
print 'ghighlight [-h|--help] gives usage information';
|
||||
print 'ghighlight [-v|--version] displays the version number';
|
||||
print q(This program is a 'groff' preprocessor that handles highlighting source code ) .
|
||||
q(parts in 'roff' files.);
|
||||
exit;
|
||||
} elsif ( /^(-v|--v|--ve|--ver|--vers|--versi|--versio|--version)$/ ) {
|
||||
print q('ghighlight' version ) . $version;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
my $macros = "groff_mm";
|
||||
if ( $ENV{'GHLENABLECOLOR'} ) {
|
||||
$macros = "groff_mm_color";
|
||||
}
|
||||
########################################################################
|
||||
# input
|
||||
########################################################################
|
||||
|
||||
my $source_mode = 0;
|
||||
|
||||
my @lines = ();
|
||||
|
||||
|
||||
sub getTroffLine {
|
||||
my ($opt) = @_;
|
||||
if ($opt =~ /^ps=([0-9]+)/) {".ps $1"}
|
||||
elsif ($opt =~ /^vs=(\S+)/) {".vs $1"}
|
||||
else { print STDERR "didn't recognised '$opt'"; ""}
|
||||
}
|
||||
|
||||
sub getTroffLineOpposite {
|
||||
my ($opt) = @_;
|
||||
if ($opt =~ /^ps=/) {".ps"}
|
||||
elsif ($opt =~ /^vs=/) {".vs"}
|
||||
else { print STDERR "didn't recognised '$opt'"; ""}
|
||||
}
|
||||
|
||||
# language for codeblocks
|
||||
my $lang = '';
|
||||
my @options = ();
|
||||
foreach (<>) {
|
||||
chomp;
|
||||
s/\s+$//;
|
||||
my $line = $_;
|
||||
my $is_dot_Source = $line =~ /^[.']\s*(``|SOURCE)(|\s+.*)$/;
|
||||
|
||||
unless ( $is_dot_Source ) { # not a '.SOURCE' line
|
||||
if ( $source_mode ) { # is running in SOURCE mode
|
||||
push @lines, $line;
|
||||
} else { # normal line, not SOURCE-related
|
||||
print $line;
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
|
||||
##########
|
||||
# now the line is a '.SOURCE' line
|
||||
|
||||
my $args = $line;
|
||||
$args =~ s/\s+$//; # remove final spaces
|
||||
$args =~ s/^[.']\s*(``|SOURCE)\s*//; # omit .source part, leave the arguments
|
||||
|
||||
my @args = split /\s+/, $args;
|
||||
|
||||
##########
|
||||
# start SOURCE mode
|
||||
|
||||
$lang = $args[0] if ( @args > 0 && $args[0] ne 'stop' );
|
||||
|
||||
if ( @args > 0 && $args[0] ne 'stop' ) {
|
||||
# For '.``' no args or first arg 'start' means opening 'SOURCE' mode.
|
||||
# Everything else means an ending command.
|
||||
|
||||
shift @args;
|
||||
@options = @args;
|
||||
|
||||
if ( $source_mode ) {
|
||||
# '.SOURCE' was started twice, ignore
|
||||
print STDERR q('.``' starter was run several times);
|
||||
next;
|
||||
} else { # new SOURCE start
|
||||
$source_mode = 1;
|
||||
@lines = ();
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
##########
|
||||
# now the line must be a SOURCE ending line (stop)
|
||||
|
||||
unless ( $source_mode ) {
|
||||
print STDERR 'ghighlight.pl: there was a SOURCE ending without being in ' .
|
||||
'SOURCE mode:';
|
||||
print STDERR ' ' . $line;
|
||||
next;
|
||||
}
|
||||
|
||||
$source_mode = 0; # 'SOURCE' stop calling is correct
|
||||
|
||||
my $shopts = $ENV{"SHOPTS"} || "";
|
||||
|
||||
##########
|
||||
# Run source-highlight on lines
|
||||
# Check if language was specified
|
||||
my $cmdline = "source-highlight -f $macros $shopts --output STDOUT";
|
||||
if ($lang ne '') {
|
||||
$cmdline .= " -s $lang";
|
||||
}
|
||||
|
||||
# Start `source-highlight`
|
||||
my $pid = open3(my $child_in, my $child_out, my $child_err, $cmdline)
|
||||
or die "open3() failed $!";
|
||||
|
||||
# Provide source code to `source-highlight` in its standard input
|
||||
print $child_in $_ for @lines;
|
||||
close $child_in;
|
||||
|
||||
if (my $v = $ENV{"GH_INTRO"}) {
|
||||
print for split /;/, $v;
|
||||
}
|
||||
|
||||
for (@options) {
|
||||
my $l = getTroffLine $_;
|
||||
print $l if ($l ne "");
|
||||
}
|
||||
|
||||
# Print `source-highlight` output
|
||||
while (<$child_out>) {
|
||||
chomp;
|
||||
print;
|
||||
}
|
||||
close $child_out;
|
||||
|
||||
for (reverse @options) {
|
||||
my $l = getTroffLineOpposite $_;
|
||||
print $l if ($l ne "");
|
||||
}
|
||||
|
||||
if (my $v = $ENV{"GH_OUTRO"}) {
|
||||
print for split /;/, $v;
|
||||
}
|
||||
|
||||
my @print_res = (1);
|
||||
|
||||
# Start argument processing
|
||||
|
||||
# remove 'stop' arg if exists
|
||||
# shift @args if ( $args[0] eq 'stop' );
|
||||
|
||||
# if ( @args == 0 ) {
|
||||
# # no args for saving, so @print_res doesn't matter
|
||||
# next;
|
||||
# }
|
||||
# my @var_names = ();
|
||||
# my @mode_names = ();
|
||||
|
||||
# my $mode = '.ds';
|
||||
# for ( @args ) {
|
||||
# if ( /^\.?ds$/ ) {
|
||||
# $mode = '.ds';
|
||||
# next;
|
||||
# }
|
||||
# if ( /^\.?nr$/ ) {
|
||||
# $mode = '.nr';
|
||||
# next;
|
||||
# }
|
||||
# push @mode_names, $mode;
|
||||
# push @var_names, $_;
|
||||
# }
|
||||
|
||||
# my $n_vars = @var_names;
|
||||
|
||||
# if ( $n_vars < $n_res ) {
|
||||
# print STDERR 'ghighlight: not enough variables for Python part: ' .
|
||||
# $n_vars . ' variables for ' . $n_res . ' output lines.';
|
||||
# } elsif ( $n_vars > $n_res ) {
|
||||
# print STDERR 'ghighlight: too many variablenames for Python part: ' .
|
||||
# $n_vars . ' variables for ' . $n_res . ' output lines.';
|
||||
# }
|
||||
# if ( $n_vars < $n_res ) {
|
||||
# print STDERR 'ghighlight: not enough variables for Python part: ' .
|
||||
# $n_vars . ' variables for ' . $n_res . ' output lines.';
|
||||
# }
|
||||
|
||||
# my $n_min = $n_res;
|
||||
# $n_min = $n_vars if ( $n_vars < $n_res );
|
||||
# exit unless ( $n_min );
|
||||
# $n_min -= 1; # for starting with 0
|
||||
|
||||
# for my $i ( 0..$n_min ) {
|
||||
# my $value = $print_res[$i];
|
||||
# chomp $value;
|
||||
# print $mode_names[$i] . ' ' . $var_names[$i] . ' ' . $value;
|
||||
# }
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
# Local Variables:
|
||||
# mode: CPerl
|
||||
# End:
|
39
bin/rsum2line.awk
Executable file
39
bin/rsum2line.awk
Executable file
@ -0,0 +1,39 @@
|
||||
#!/usr/bin/awk -f
|
||||
|
||||
BEGIN {
|
||||
FOUND_95pct = 0
|
||||
FOUND_mean = 0
|
||||
}
|
||||
|
||||
FOUND_95pct == 1 {
|
||||
pct_min = $1
|
||||
pct_max = $2
|
||||
FOUND_95pct = 0
|
||||
}
|
||||
|
||||
FOUND_mean == 1 {
|
||||
mean = $1
|
||||
print pct_min, median, mean, pct_max, t, df, pvalue
|
||||
FOUND_mean = 0
|
||||
}
|
||||
|
||||
/^t = / {
|
||||
gsub(",", "", $3)
|
||||
t = $3
|
||||
gsub(",", "", $6)
|
||||
df = $6
|
||||
pvalue = $9
|
||||
}
|
||||
|
||||
/mean of x/ {
|
||||
FOUND_mean = 1
|
||||
}
|
||||
|
||||
/Median/ {
|
||||
gsub(":", "")
|
||||
median = $2
|
||||
}
|
||||
|
||||
/95 percent confidence/ {
|
||||
FOUND_95pct = 1
|
||||
}
|
42
bin/stats.sh
Executable file
42
bin/stats.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
# .raw -> bad format -> .summary (great format)
|
||||
raw2sum="./bin/raw-to-summary.sh"
|
||||
# .summary (with too much data) -> truncated data (.t)
|
||||
truncate_data="./bin/summary-to-truncated-data.sh"
|
||||
# ./bin/extract-data-*.sh: .t -> data/XXX.d (paste an index + *.t)
|
||||
|
||||
if [ $# -ne 1 ]
|
||||
then
|
||||
echo "usage: $0 result-directory"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
dir="$1"
|
||||
|
||||
$raw2sum "${dir}"
|
||||
|
||||
# List raw files with the number of iterations as a prefix so they can then be sorted.
|
||||
sort_summary_files() {
|
||||
for i in $dir/*.summary ; do f $i ; done | sort -n
|
||||
}
|
||||
|
||||
f() {
|
||||
echo $* | sed "s/[_./]/ /g" | xargs echo "$* " | awk '{ printf "%s %s/%s_%s %s\n", $4, $2, $3, $5, $1 }'
|
||||
}
|
||||
|
||||
fill() {
|
||||
# Remove previous computations.
|
||||
rm ${dir}/*.d
|
||||
while read LINE; do
|
||||
nb_it=$(echo $LINE | awk '{ print $1 }')
|
||||
target=$(echo $LINE | awk '{ print $2 }')
|
||||
fname=$(echo $LINE | awk '{ print $3 }')
|
||||
|
||||
cat $fname | xargs echo "$nb_it " >> $target.d
|
||||
done
|
||||
}
|
||||
|
||||
sort_summary_files | fill
|
||||
|
||||
$truncate_data "${dir}"
|
16
bin/summary-to-truncated-data.sh
Executable file
16
bin/summary-to-truncated-data.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -ne 1 ]
|
||||
then
|
||||
echo "usage: $0 result-directory"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
dir=$1
|
||||
|
||||
echo "from data (.d) to truncated data (.t)"
|
||||
for i in $dir/*.d
|
||||
do
|
||||
fname=$(echo $i | sed "s/[.]d$/.t/")
|
||||
awk '{ print $2, $3, $5 }' < $i > $fname
|
||||
done
|
14
bin/summary.r
Normal file
14
bin/summary.r
Normal file
@ -0,0 +1,14 @@
|
||||
# Rscript summary handshake-duration.txt
|
||||
|
||||
require(grDevices) # for colours
|
||||
|
||||
tbl <- read.table(file=commandArgs(TRUE)[1])
|
||||
val <- tbl[1]
|
||||
|
||||
summary(val)
|
||||
# standarddeviation=sd(unlist(val))
|
||||
sd(unlist(val))
|
||||
# print (standarddeviation, zero.print="standard deviation: ")
|
||||
|
||||
# confint.default (val)
|
||||
t.test (val)
|
147
bin/utf8-to-ms.sh
Executable file
147
bin/utf8-to-ms.sh
Executable file
@ -0,0 +1,147 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This program isn't by any mean complete.
|
||||
# Most of text markers, accents and ligatures are handled.
|
||||
# However, nothing else currently is.
|
||||
# Please, do provide more translations.
|
||||
|
||||
# Convert input into hexadecimal and a single byte per line.
|
||||
to_hex_one_column() xxd -p -c 1
|
||||
|
||||
# Reverse hexadecimal to original value.
|
||||
from_hex() xxd -p -r
|
||||
|
||||
regroup_lines() awk '
|
||||
BEGIN {
|
||||
line_start=1
|
||||
}
|
||||
|
||||
{
|
||||
if (line_start == 1)
|
||||
line = $1;
|
||||
else
|
||||
line = line " " $1;
|
||||
|
||||
line_start = 0;
|
||||
if ($1 == "0a") {
|
||||
print line;
|
||||
line_start = 1
|
||||
}
|
||||
}
|
||||
|
||||
END {
|
||||
if (line_start == 0)
|
||||
print line
|
||||
}
|
||||
'
|
||||
|
||||
accents() sed \
|
||||
-e "s/c3 81/5c 5b 27 41 5d/g"\
|
||||
-e "s/c3 89/5c 5b 27 45 5d/g"\
|
||||
-e "s/c3 8d/5c 5b 27 49 5d/g"\
|
||||
-e "s/c3 93/5c 5b 27 4f 5d/g"\
|
||||
-e "s/c3 9a/5c 5b 27 55 5d/g"\
|
||||
-e "s/c3 9d/5c 5b 27 59 5d/g"\
|
||||
-e "s/c3 a1/5c 5b 27 61 5d/g"\
|
||||
-e "s/c3 a9/5c 5b 27 65 5d/g"\
|
||||
-e "s/c3 ad/5c 5b 27 69 5d/g"\
|
||||
-e "s/c3 b3/5c 5b 27 6f 5d/g"\
|
||||
-e "s/c3 ba/5c 5b 27 75 5d/g"\
|
||||
-e "s/c3 bd/5c 5b 27 79 5d/g"\
|
||||
-e "s/c3 84/5c 5b 3a 41 5d/g"\
|
||||
-e "s/c3 8b/5c 5b 3a 45 5d/g"\
|
||||
-e "s/c3 8f/5c 5b 3a 49 5d/g"\
|
||||
-e "s/c3 96/5c 5b 3a 4f 5d/g"\
|
||||
-e "s/c3 9c/5c 5b 3a 55 5d/g"\
|
||||
-e "s/c3 a4/5c 5b 3a 61 5d/g"\
|
||||
-e "s/c3 ab/5c 5b 3a 65 5d/g"\
|
||||
-e "s/c3 af/5c 5b 3a 69 5d/g"\
|
||||
-e "s/c3 b6/5c 5b 3a 6f 5d/g"\
|
||||
-e "s/c3 bc/5c 5b 3a 75 5d/g"\
|
||||
-e "s/c3 bf/5c 5b 3a 79 5d/g"\
|
||||
-e "s/c3 82/5c 5b 5e 41 5d/g"\
|
||||
-e "s/c3 8a/5c 5b 5e 45 5d/g"\
|
||||
-e "s/c3 8e/5c 5b 5e 49 5d/g"\
|
||||
-e "s/c3 94/5c 5b 5e 4f 5d/g"\
|
||||
-e "s/c3 9b/5c 5b 5e 55 5d/g"\
|
||||
-e "s/c3 a2/5c 5b 5e 61 5d/g"\
|
||||
-e "s/c3 aa/5c 5b 5e 65 5d/g"\
|
||||
-e "s/c3 ae/5c 5b 5e 69 5d/g"\
|
||||
-e "s/c3 b4/5c 5b 5e 6f 5d/g"\
|
||||
-e "s/c3 bb/5c 5b 5e 75 5d/g"\
|
||||
-e "s/c3 80/5c 5b 60 41 5d/g"\
|
||||
-e "s/c3 88/5c 5b 60 45 5d/g"\
|
||||
-e "s/c3 8c/5c 5b 60 49 5d/g"\
|
||||
-e "s/c3 92/5c 5b 60 4f 5d/g"\
|
||||
-e "s/c3 99/5c 5b 60 55 5d/g"\
|
||||
-e "s/c3 a0/5c 5b 60 61 5d/g"\
|
||||
-e "s/c3 a8/5c 5b 60 65 5d/g"\
|
||||
-e "s/c3 ac/5c 5b 60 69 5d/g"\
|
||||
-e "s/c3 b2/5c 5b 60 6f 5d/g"\
|
||||
-e "s/c3 b9/5c 5b 60 75 5d/g"\
|
||||
-e "s/c3 83/5c 5b 7e 41 5d/g"\
|
||||
-e "s/c3 91/5c 5b 7e 4e 5d/g"\
|
||||
-e "s/c3 95/5c 5b 7e 4f 5d/g"\
|
||||
-e "s/c3 a3/5c 5b 7e 61 5d/g"\
|
||||
-e "s/c3 b1/5c 5b 7e 6e 5d/g"\
|
||||
-e "s/c3 b5/5c 5b 7e 6f 5d/g"\
|
||||
-e "s/c3 87/5c 5b 2c 43 5d/g"\
|
||||
-e "s/c3 a7/5c 5b 2c 63 5d/g"\
|
||||
-e "s/c3 85/5c 5b 6f 41 5d/g"\
|
||||
-e "s/c3 a5/5c 5b 6f 61 5d/g"\
|
||||
-e "s/c5 b8/5c 5b 3a 59 5d/g"\
|
||||
-e "s/c5 a0/5c 5b 76 53 5d/g"\
|
||||
-e "s/c5 a1/5c 5b 76 73 5d/g"\
|
||||
-e "s/c5 bd/5c 5b 76 5a 5d/g"\
|
||||
-e "s/c5 be/5c 5b 76 7a 5d/g"
|
||||
|
||||
# Ligatures.
|
||||
ligatures() sed \
|
||||
-e "s/ef ac 80/5c 5b 66 66 5d/g"\
|
||||
-e "s/ef ac 81/5c 5b 66 69 5d/g"\
|
||||
-e "s/ef ac 82/5c 5b 66 6c 5d/g"\
|
||||
-e "s/ef ac 83/5c 5b 46 69 5d/g"\
|
||||
-e "s/ef ac 84/5c 5b 46 6c 5d/g"\
|
||||
-e "s/c5 81/5c 5b 2f 4c 5d/g"\
|
||||
-e "s/c5 82/5c 5b 2f 6c 5d/g"\
|
||||
-e "s/c3 98/5c 5b 2f 4f 5d/g"\
|
||||
-e "s/c3 b8/5c 5b 2f 6f 5d/g"\
|
||||
-e "s/c3 86/5c 5b 41 45 5d/g"\
|
||||
-e "s/c3 a6/5c 5b 61 65 5d/g"\
|
||||
-e "s/c5 92/5c 5b 4f 45 5d/g"\
|
||||
-e "s/c5 93/5c 5b 6f 65 5d/g"\
|
||||
-e "s/c4 b2/5c 5b 49 4a 5d/g"\
|
||||
-e "s/c4 b3/5c 5b 69 6a 5d/g"\
|
||||
-e "s/c4 b1/5c 5b 2e 69 5d/g"\
|
||||
-e "s/c8 b7/5c 5b 2e 6a 5d/g"
|
||||
|
||||
# Text markers.
|
||||
text_markers() sed \
|
||||
-e "s/e2 97 8b/5c 5b 63 69 5d/g"\
|
||||
-e "s/e2 80 a2/5c 5b 62 75 5d/g"\
|
||||
-e "s/e2 80 a1/5c 5b 64 64 5d/g"\
|
||||
-e "s/e2 80 a0/5c 5b 64 67 5d/g"\
|
||||
-e "s/e2 97 8a/5c 5b 6c 7a 5d/g"\
|
||||
-e "s/e2 96 a1/5c 5b 73 71 5d/g"\
|
||||
-e "s/c2 b6/5c 5b 70 73 5d/g"\
|
||||
-e "s/c2 a7/5c 5b 73 63 5d/g"\
|
||||
-e "s/e2 98 9c/5c 5b 6c 68 5d/g"\
|
||||
-e "s/e2 98 9e/5c 5b 72 68 5d/g"\
|
||||
-e "s/e2 86 b5/5c 5b 43 52 5d/g"\
|
||||
-e "s/e2 9c 93/5c 5b 4f 4b 5d/g"
|
||||
|
||||
# These markers shouldn't be automatically translated in ms macros.
|
||||
# @ "s/40/5c 5b 61 74 5d/g"
|
||||
# # "s/23/5c 5b 73 68 5d/g"
|
||||
|
||||
# Legal symbols.
|
||||
legal_symbols() sed \
|
||||
-e "s/c2 a9/5c 5b 63 6f 5d/g"\
|
||||
-e "s/c2 ae/5c 5b 72 67 5d/g"\
|
||||
-e "s/e2 84 a2/5c 5b 74 6d 5d/g"
|
||||
|
||||
hexutf8_to_hexms() {
|
||||
text_markers | accents | ligatures | legal_symbols
|
||||
}
|
||||
|
||||
to_hex_one_column | regroup_lines | hexutf8_to_hexms | from_hex
|
49
data/index.d
Normal file
49
data/index.d
Normal file
@ -0,0 +1,49 @@
|
||||
1000 109.3724 120.0 149.3276 110.7882 120 157.2918 162.5658 176.0 277.9142 15370.25 14725 18685.21 18187.83 17627 24197.23
|
||||
2000 97.24123 113.0 171.35877 93.41446 111.0 173.58554 150.6903 165.0 285.6897 14597.92 14268 16813.36 18879.45 19001 22834.83
|
||||
3000 103.0883 115 158.9917 100.9986 112.0 155.2814 154.4989 164.0 264.6211 14247.09 14140 16447.25 17817.76 17350 20412.78
|
||||
4000 117.2374 130.0 174.3026 97.79489 112.0 165.66511 128.0418 174.0 493.0982 14105.34 14082 16422.90 18759.85 19584 22402.63
|
||||
5000 106.0937 118.0 173.0463 110.96 125.0 185.84 -195.3728 177.0 1550.4728 14525.07 13982 17369.13 17541.12 17432 21223.86
|
||||
6000 83.89958 113.0 207.96042 92.97882 111.0 169.16118 -286.1952 177.0 1744.7552 15322.56 15154 18244.12 18655.75 18334 22606.77
|
||||
7000 93.87028 115.0 186.90972 93.98149 113.0 184.19851 -692.4847 171 2895.7047 14629.95 14294 17098.07 20293.82 20819 23339.40
|
||||
8000 99.4293 113.0 165.9907 89.44064 112.0 188.85936 -665.4418 172 2809.0218 15418.50 14881 19270.92 17427.01 17370 23084.57
|
||||
9000 89.92345 113.0 190.17655 84.89233 119.0 237.54767 -202.8011 174.0 1498.0611 14761.77 14271 17416.43 18926.34 18373 24650.78
|
||||
10000 100.9453 115.0 168.9347 101.3982 116.0 165.4218 -237.5687 183.0 1557.2887 23487.26 21978 27871.00 28545.54 27242 34224.06
|
||||
11000 104.5516 121.0 180.9884 88.26649 112.0 189.95351 -412.4357 163.0 2028.8757 24072.96 23445 28804.28 29199.45 29508 43085.15
|
||||
12000 90.55463 113.0 183.88537 104.5684 119.0 163.9516 -330.3343 171.0 1815.1943 21855.86 21462 24353.30 24575.85 24636 28061.03
|
||||
13000 104.6789 113.0 140.8011 109.1926 119.0 160.4074 -360.3683 171.0 1933.0083 22414.18 21382 26679.88 25318.41 24740 28881.05
|
||||
14000 102.3711 113.0 158.6489 105.9358 119.0 162.3842 -398.5965 191.0 2090.3765 22488.45 21739 26805.05 27483.78 26217 32406.50
|
||||
15000 106.6945 114.0 159.0455 106.6131 120.0 171.8269 -353.7423 175.0 1883.3423 22485.28 21876 25650.80 27288.86 26337 31788.38
|
||||
16000 99.16027 113.0 156.35973 100.3977 120.0 174.0623 -414.7897 179.0 2119.8897 20701.83 20579 26171.93 25989.28 24848 30659.02
|
||||
17000 100.5403 112.5 165.1797 98.57438 119.0 172.10562 -383.5489 173.0 1968.5689 20466.05 22973 34949.27 28271.39 26740 32487.43
|
||||
18000 100.8786 116.0 173.3814 102.8423 122.0 185.5977 -284.1822 173.0 1671.6822 24180.33 22662 28767.81 23252.91 26601 43768.21
|
||||
19000 99.28684 113.0 168.21316 103.4369 121.0 169.3831 -347.5273 191.0 1933.2073 21820.31 21204 24790.29 29294.74 29355 33273.36
|
||||
20000 101.5607 114.0 163.4393 106.0684 119.0 163.1716 -389.5021 169.0 1971.9621 22047.27 22450 27324.23 25568.55 25116 32569.73
|
||||
21000 101.9594 113.0 149.4606 102.5919 117.5 156.6481 -259.9216 175 1595.9016 23185.63 22750 26646.75 26674.94 25360 31885.22
|
||||
22000 93.90566 113.0 172.95434 98.50795 111.0 154.47205 -360.6263 176.0 1903.6863 23356.97 22372 27830.13 27726.30 27627 37182.22
|
||||
23000 110.0059 122 157.9141 104.9991 119.0 159.9409 -272.795 160.0 1562.435 24639.83 25687 30593.81 25639.64 24870 28340.60
|
||||
24000 132.8882 152 223.1318 106.8899 119.0 154.2301 -641.3508 170.0 3061.7108 21517.35 20919 23770.49 25671.77 24754 35983.71
|
||||
25000 97.12965 113.0 166.99035 98.67605 112.0 158.36395 -759.1279 170 3093.8279 22017.53 21409 24949.29 26141.86 25322 29655.40
|
||||
26000 94.80599 113.0 168.47401 103.5701 119.0 169.6699 -753.0398 170 3072.8398 22984.03 22220 27417.97 27292.31 26510 31543.23
|
||||
27000 94.96552 113.0 170.71448 101.5061 120.0 176.1739 -449.023 183.0 2235.143 19854.38 20289 31928.96 29802.04 28992 34076.34
|
||||
28000 99.86706 112 152.23294 103.7609 119.0 167.5191 -433.1759 200.0 2299.0359 21677.48 21060 25419.48 26592.69 25651 30744.31
|
||||
29000 372.8193 392.5 471.3007 105.1664 119.0 162.5736 -448.3971 183.0 2248.8571 20844.73 20637 24197.41 29296.67 29865 32848.43
|
||||
30000 94.11193 114.0 180.72807 105.3617 119.0 161.0183 -725.1916 170 2985.1516 21613.01 21480 26895.53 27707.56 26902 32592.68
|
||||
31000 94.55682 113.0 200.08318 99.82525 119.0 184.01475 -338.1358 170.0 1805.5958 26113.71 25403 30575.23 24335.24 25757 40419.46
|
||||
32000 93.73904 112.0 170.86096 107.164 122 174.916 -419.3431 172.0 2056.3231 23189.88 22693 27108.52 26171.05 25282 31437.45
|
||||
33000 105.8513 113.0 158.3287 104.0877 119.0 160.2723 -270.7942 163.0 1572.5342 21385.07 20848 23826.29 26958.78 25888 30874.02
|
||||
34000 102.3427 113.0 160.3173 -262.7567 90.00 1248.8767 -412.095 171.0 2083.715 22540.63 21727 25882.29 27474.0 27148 31402.6
|
||||
35000 101.988 115 163.992 104.8456 119.0 164.4344 -777.9169 168.0 3184.9369 21638.96 21436 24103.12 26461.00 26104 31258.42
|
||||
36000 91.2566 113.0 190.2034 97.44665 119.0 173.27335 -480.1585 170.0 2243.3185 23204.36 22350 26323.34 25881.73 24798 29958.49
|
||||
37000 100.9142 113 148.9858 103.2993 114.0 152.3807 -524.7963 171.0 2400.9363 23006.19 21916 27110.31 25052.16 24618 27717.62
|
||||
38000 95.2645 113.0 185.2955 93.34441 111.0 175.33559 -424.2406 169.0 2063.5006 22499.69 22104 25037.55 23618.71 25886 40918.29
|
||||
39000 84.33232 113.0 203.32768 92.21911 112.0 180.42089 -350.508 159.5 2257.368 21823.99 21006 24485.73 26132.24 25172 33859.46
|
||||
40000 102.0963 114.0 160.2237 107.56 121.0 168.74 -347.5637 176.0 1880.7437 21327.97 21176 26959.05 26937.45 25962 32398.97
|
||||
41000 95.44862 113.0 167.45138 101.7707 119 162.1493 -384.177 165.5 1958.797 22641.39 25382 40607.81 26451.43 25392 30765.23
|
||||
42000 97.05713 114.0 180.80287 -252.3245 113.0 1282.6445 -390.3223 163.0 2069.2023 20957.0 20774 24538.6 26898.77 25596 32303.09
|
||||
43000 107.4423 121.0 172.0577 100.9222 119.0 176.8378 -422.0223 170.0 2106.9223 21146.42 21122 23722.50 27944.65 26254 32830.11
|
||||
44000 108.7911 120.0 157.9689 -255.111 101.0 1274.471 -424.9622 170.0 2095.1622 23029.37 22396 27845.83 26345.98 25338 29618.62
|
||||
45000 102.5206 113.0 148.8594 102.2013 119.0 173.2587 -426.8225 170 2084.8425 22025.20 21728 26903.86 -727880.2 28155 2334788.1
|
||||
46000 97.15623 113.0 162.94377 102.6992 117.0 162.5808 -721.5646 170 2988.6446 20927.06 21780 35703.26 22944.94 25774 40154.88
|
||||
47000 84.24103 112.0 201.11897 83.00339 111.00 160.73661 -779.993 170 3149.993 21161.16 20816 24110.88 25446.62 24960 28297.66
|
||||
48000 103.5623 117.0 181.9577 106.1732 123.0 181.0068 -364.7142 186.0 1961.8742 22028.45 21958 24806.11 26057.35 24858 30553.19
|
||||
49000 90.44346 114.0 190.87654 88.18667 111.0 153.47333 -354.6176 170.0 1874.3576 23452.99 22040 27717.63 31557.44 31422 37588.08
|
100000
data/lru_100000_100000.d
Normal file
100000
data/lru_100000_100000.d
Normal file
File diff suppressed because it is too large
Load Diff
100
data/lru_100000_100000_redux.d
Normal file
100
data/lru_100000_100000_redux.d
Normal file
@ -0,0 +1,100 @@
|
||||
1000 6523.0 117.0
|
||||
2000 12848.0 82.0
|
||||
3000 7311.0 81.0
|
||||
4000 5784.0 101.0
|
||||
5000 9036.0 83.0
|
||||
6000 11619.0 103.0
|
||||
7000 10136.0 107.0
|
||||
8000 11722.0 131.0
|
||||
9000 13009.0 82.0
|
||||
10000 14422.0 103.0
|
||||
11000 15850.0 82.0
|
||||
12000 17281.0 201.0
|
||||
13000 18703.0 103.0
|
||||
14000 25187.0 81.0
|
||||
15000 27016.0 107.0
|
||||
16000 23010.0 124.0
|
||||
17000 24443.0 120.0
|
||||
18000 25873.0 86.0
|
||||
19000 34139.0 308.0
|
||||
20000 28742.0 82.0
|
||||
21000 30178.0 84.0
|
||||
22000 31610.0 182.0
|
||||
23000 33018.0 200.0
|
||||
24000 74792.0 83.0
|
||||
25000 45018.0 209.0
|
||||
26000 46648.0 102.0
|
||||
27000 64619.0 172.0
|
||||
28000 40205.0 107.0
|
||||
29000 41642.0 195.0
|
||||
30000 43070.0 96.0
|
||||
31000 55635.0 85.0
|
||||
32000 45938.0 94.0
|
||||
33000 47375.0 87.0
|
||||
34000 48828.0 102.0
|
||||
35000 50296.0 180.0
|
||||
36000 51671.0 306.0
|
||||
37000 53103.0 181.0
|
||||
38000 54538.0 308.0
|
||||
39000 55969.0 179.0
|
||||
40000 57423.0 181.0
|
||||
41000 104576.0 180.0
|
||||
42000 60306.0 179.0
|
||||
43000 61808.0 180.0
|
||||
44000 117821.0 218.0
|
||||
45000 64677.0 176.0
|
||||
46000 66173.0 293.0
|
||||
47000 67613.0 182.0
|
||||
48000 69053.0 180.0
|
||||
49000 73815.0 189.0
|
||||
50000 71914.0 185.0
|
||||
51000 73359.0 289.0
|
||||
52000 99921.0 116.0
|
||||
53000 76256.0 201.0
|
||||
54000 104055.0 179.0
|
||||
55000 79128.0 277.0
|
||||
56000 80567.0 118.0
|
||||
57000 82006.0 455.0
|
||||
58000 83440.0 530.0
|
||||
59000 84879.0 314.0
|
||||
60000 86307.0 86.0
|
||||
61000 87758.0 253.0
|
||||
62000 89186.0 292.0
|
||||
63000 90633.0 649.0
|
||||
64000 92076.0 204.0
|
||||
65000 94432.0 300.0
|
||||
66000 94951.0 456.0
|
||||
67000 96386.0 180.0
|
||||
68000 97825.0 180.0
|
||||
69000 128849.0 327.0
|
||||
70000 100731.0 201.0
|
||||
71000 102131.0 169.0
|
||||
72000 103574.0 173.0
|
||||
73000 105009.0 201.0
|
||||
74000 106444.0 116.0
|
||||
75000 107878.0 190.0
|
||||
76000 109317.0 177.0
|
||||
77000 110746.0 176.0
|
||||
78000 112184.0 292.0
|
||||
79000 142068.0 170.0
|
||||
80000 115060.0 87.0
|
||||
81000 116492.0 176.0
|
||||
82000 117935.0 404.0
|
||||
83000 122138.0 325.0
|
||||
84000 120799.0 292.0
|
||||
85000 122269.0 308.0
|
||||
86000 123688.0 297.0
|
||||
87000 125124.0 333.0
|
||||
88000 126556.0 351.0
|
||||
89000 128761.0 214.0
|
||||
90000 129438.0 182.0
|
||||
91000 130871.0 455.0
|
||||
92000 177811.0 181.0
|
||||
93000 134150.0 105.0
|
||||
94000 135181.0 105.0
|
||||
95000 206680.0 181.0
|
||||
96000 138050.0 255.0
|
||||
97000 182654.0 198.0
|
||||
98000 140931.0 289.0
|
||||
99000 142364.0 383.0
|
||||
100000 143808.0 297.0
|
49
data/lru_index.d
Normal file
49
data/lru_index.d
Normal file
@ -0,0 +1,49 @@
|
||||
1000 -402.0069 172 2427.2869 175.9912 185.0 283.7688 -76.00528 169.0 2008.08528 164.1485 177.0 303.7915
|
||||
2000 -142.6827 175.0 1265.0827 168.9182 162.0 258.1418 164.3774 167 273.6626 166.4925 179.0 266.8875
|
||||
3000 -87.0538 164.0 1474.4738 -167.2984 172.0 1342.0784 117.0175 170.0 484.7425 151.2088 159.5 260.7712
|
||||
4000 -63.31638 161.0 1061.05638 -158.4152 183.0 1366.9152 62.90929 172.0 647.77071 160.5387 170.0 260.1013
|
||||
5000 3.841338 172 1186.198662 -116.6747 173.0 1626.8547 -173.6707 169.0 1299.4507 148.2143 159.0 266.4057
|
||||
6000 -64.38611 161.0 1252.92611 -107.36 166.0 1062.54 -124.7399 172.0 1217.5599 158.3102 170.0 257.4698
|
||||
7000 -111.0442 161.0 1073.4042 -174.0075 161.0 1344.3275 -128.0261 158.5 1217.4861 165.0525 164.0 318.6475
|
||||
8000 -96.8718 169.0 1208.9518 -99.94616 170.0 1502.06616 -204.9209 159.0 1377.7609 -237.3351 178.0 1532.0351
|
||||
9000 -202.2942 182.0 1432.7742 -189.8625 170.0 1362.5025 -163.267 172.0 1346.207 -114.0843 178.0 1260.5643
|
||||
10000 -241.1002 161.0 1495.8802 -380.6291 170.0 1958.7691 -196.7312 186.0 1558.3712 -306.2586 190.0 1810.4986
|
||||
11000 -335.4891 182.0 1850.0091 -301.2861 161.0 1647.5861 -236.2089 170.0 1553.3489 -325.1701 187.0 1831.4101
|
||||
12000 -349.2377 160.0 1810.0777 -275.1015 164.0 1584.8215 -378.5749 158.0 1873.3549 -257.1289 175.0 1646.6289
|
||||
13000 -132.1295 172.0 1668.8695 -278.4298 160.0 1568.5498 -318.9207 184.0 1827.5807 -200.5193 202.0 1601.3793
|
||||
14000 -375.2257 170.0 1902.5857 -447.7806 170.0 2214.7806 -343.8684 162.0 1936.4484 -238.839 192.0 1637.959
|
||||
15000 -256.2965 164.0 1502.8165 -498.7963 170 2276.7763 -233.241 172.0 1513.461 -234.6921 194.0 1595.6921
|
||||
16000 -320.6488 176.0 1801.0088 -247.3584 167.0 1572.1584 -236.0818 159 1754.1618 -292.8538 174.0 1683.5538
|
||||
17000 -525.9812 176.0 2382.7012 -293.3954 161.0 1679.9154 -368.7892 172.0 1984.9092 -377.8867 176.0 1946.1667
|
||||
18000 -648.8121 173.0 3092.8121 -233.5228 188.0 1616.2428 -298.4049 176.0 1705.3449 -210.2533 168.0 1403.4933
|
||||
19000 -221.6955 161.0 1451.9155 -386.7036 170.0 1956.3836 -238.9695 178.0 1544.3495 -202.6783 171.0 1489.4783
|
||||
20000 -367.0221 179.0 1902.4621 -216.6317 171.0 1442.8517 -705.3572 170 3253.8772 -298.0587 175.0 1702.7387
|
||||
21000 -544.8885 175 2882.2485 -297.9679 174.0 1777.7079 -231.111 172.0 1496.731 -667.3969 172 2869.2569
|
||||
22000 -27230.15 161 85196.13 -175.3556 175 1461.3356 -214.8747 246.0 1802.0547 -507.6827 195.0 2430.7827
|
||||
23000 -302.0954 172 1712.1554 -328.7971 174.0 1790.1171 -282.715 173.0 1664.755 -350.0649 196.0 1967.7249
|
||||
24000 -418.256 170.0 2161.076 -253.0194 160 1533.0394 -359.7431 159.0 1829.7231 -251.8042 205.0 1717.9042
|
||||
25000 -198.1571 171.0 1950.7371 -254.2933 177.0 1591.8933 -284.9042 185.0 1715.4842 -188.4496 178.0 1548.2696
|
||||
26000 -220.6809 160.0 1427.5209 -198.244 160.0 1391.704 -331.4497 161.0 1767.3097 -230.7932 175.0 1516.8732
|
||||
27000 -313.938 175.0 1792.298 -319.2061 160.0 1704.6261 -318.3466 171.0 1743.8266 -318.0785 184.5 1795.2585
|
||||
28000 -375.3797 161 1895.4197 -275.3547 183.0 1703.1347 -415.7376 172.0 2098.5776 -292.2983 183.0 1758.7383
|
||||
29000 -276.1194 172.5 1680.8794 -351.7911 171.0 1902.3911 -211.4906 171.0 1411.7306 -321.2402 175.0 1800.9002
|
||||
30000 -267.7118 176.0 1640.7318 -376.5194 170.0 1911.8194 -236.3368 170.0 1510.1968 -310.7225 175.0 1770.9825
|
||||
31000 -224.6149 158.0 1415.6149 -247.9122 181.0 1591.0522 -292.1974 184.0 1753.4574 -313.6216 187.0 1809.3616
|
||||
32000 -280.222 171.0 1698.802 -514.5683 187.0 2409.6083 -252.9709 177.0 1631.6309 -2604.026 200.0 11060.306
|
||||
33000 -300.5319 171.0 1669.7919 -188.3859 160.0 1378.8659 -730.8586 175 3023.7586 -218.8753 180.0 1491.2553
|
||||
34000 -255.552 164.0 1606.152 -254.6239 166.0 1531.4439 -223.2933 161 1443.2733 -298.4146 163.0 1694.5546
|
||||
35000 -349.3114 179.0 1949.5114 -489.9953 171.0 2281.5753 -388.0522 171.0 1958.9922 -680.3365 175 2866.8365
|
||||
36000 -263.1375 165.5 1721.0375 -277.1259 160.0 1596.6459 -407.1215 163.0 2082.8815 -257.0347 168.0 1628.1147
|
||||
37000 -249.5213 160.0 1545.7613 -312.7545 171.0 1762.5145 -337.7234 217.0 2019.0634 -218.8514 174.5 1464.3314
|
||||
38000 -190.8922 172.0 1409.8322 -369.7589 160.0 1916.5589 -326.3183 171.0 1760.6383 -2774.949 199 9864.429
|
||||
39000 -276.9466 161.0 1648.0466 -311.9187 175.0 1751.3387 -292.131 160.0 1656.771 -269.051 164.0 1577.471
|
||||
40000 -379.5287 187.0 2023.0287 -331.1467 171.0 1773.7267 -318.2688 160.0 1723.6888 -226.15 180.0 1749.91
|
||||
41000 -328.2525 171.0 1750.5725 -499.2701 170.0 2281.7101 -349.1792 171.0 1834.5192 -215.8072 168.0 1424.9872
|
||||
42000 -233.5024 169.0 1498.0824 -254.3236 161.0 1534.8636 -211.5346 161.0 1389.2946 -381.2945 199.0 2062.2345
|
||||
43000 -336.3329 171.0 1819.6129 -587.2745 170 3050.4945 -259.4045 160.0 1595.0245 -426.9339 163.0 2125.1139
|
||||
44000 -447.4197 177.5 2206.9597 -288.47 160.0 1676.05 -244.2322 171.0 1931.7122 -387.7801 175.0 2027.1401
|
||||
45000 -380.9505 172 1970.8905 -455.9734 172.0 2165.0134 -290.4214 161 1650.3214 -370.4917 180.0 2014.1717
|
||||
46000 -314.7491 177.0 1867.4491 -458.15 184.0 2230.85 -494.964 173.0 2333.624 -440.0826 188.0 2188.4626
|
||||
47000 -414.7843 184.0 2127.2043 -242.4129 172.0 1521.1329 -324.2322 160.0 1772.8922 -430.9616 171.0 2099.1616
|
||||
48000 -313.1542 198.0 1945.0142 -418.2966 193.0 2314.5166 -391.4237 184.0 2021.6237 -182.8266 176.0 1500.5466
|
||||
49000 -241.9814 161.0 1492.3614 -418.5865 171.0 2046.5465 -254.3783 160.0 1526.8783 -357.1107 173.0 1920.4507
|
49
data/lru_partitions.d
Normal file
49
data/lru_partitions.d
Normal file
@ -0,0 +1,49 @@
|
||||
1000 46349146 45554860 48008901 222708.1 286571 723865.8 80077.95 237298 740524.47 -31392.76 265598 1180670.12
|
||||
2000 92435899 91615962 95067405 401997.8 789988 3627289.6 460845.4 593882 1463554.3 436283.4 658842 1685775.2
|
||||
3000 139066018 138052414 141821951 146886256 150733958 150637310 762532.6 1179371 4588274.0 764088 1087902 2093117
|
||||
4000 184031577 184029672 187016790 192653868 191845494 196066610 2377364 2953912 8898600 1575421 1657766 3897262
|
||||
5000 232254575 232360877 235316242 242381520 241791898 245382597 1442316 2957307 12314109 2201912 2236734 4564862
|
||||
6000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
7000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
8000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
9000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
10000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
11000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
12000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
13000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
14000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
15000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
16000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
17000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
18000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
19000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
20000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
21000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
22000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
23000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
24000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
25000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
26000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
27000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
28000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
29000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
30000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
31000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
32000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
33000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
34000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
35000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
36000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
37000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
38000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
39000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
40000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
41000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
42000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
43000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
44000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
45000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
46000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
47000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
48000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
49000 0 0 0 0 0 0 0 0 0 0 0 0
|
49
data/lru_tags.d
Normal file
49
data/lru_tags.d
Normal file
@ -0,0 +1,49 @@
|
||||
1000 57327.37 158228 969713.23 51773.98 119018 346903.10 -43341.3 113630 604740.6 127094.6 124828 141578.2
|
||||
2000 44896043 44525423 46018005 50063.86 381445 2285894.38 150637.1 286780 820394.3 -88324.12 269930 1421035.86
|
||||
3000 66635654 66661315 67838778 -81824.2 382950 3056880.5 572076.1 685437 2627189.8 222029 527635 1592079
|
||||
4000 86630357 86530022 87631224 -100300.3 647494 4216698.6 1000827 1831940 5408418 526332 802795 1797297
|
||||
5000 110167104 109742863 112053297 331605 1058880 5630160 498036.1 1905043 6581440.5 823976.9 1062288 2884859.7
|
||||
6000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
7000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
8000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
9000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
10000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
11000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
12000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
13000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
14000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
15000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
16000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
17000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
18000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
19000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
20000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
21000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
22000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
23000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
24000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
25000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
26000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
27000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
28000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
29000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
30000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
31000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
32000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
33000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
34000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
35000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
36000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
37000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
38000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
39000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
40000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
41000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
42000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
43000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
44000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
45000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
46000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
47000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
48000 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
49000 0 0 0 0 0 0 0 0 0 0 0 0
|
49
data/partitions.d
Normal file
49
data/partitions.d
Normal file
@ -0,0 +1,49 @@
|
||||
1000 112698.8 106648 205035.0 109163.2 111556 119760.9 -413150.4 215905 2228873.9 55310779 32607994 68184806 59540058 34354068 73549255
|
||||
2000 291492.1 264528 531866.3 257924.2 252470 279242.7 67559.68 588606 2234659.38 122314006 124993236 126096782 130576232 133560572 134471614
|
||||
3000 424337.2 364885 766042.5 79176.76 397934 1414588.42 139264 1054285 5725970 178519117 158492286 191298133 193265966 170749528 207107755
|
||||
4000 730615.4 556237 1205071.3 430059.7 623746 1607854.1 1376406 2708479 8910010 243890686 249359386 249671425 263063787 268975108 269134084
|
||||
5000 1051048 875354 1598667 521548.6 824070 1986741.8 491803.2 2768610 12496317.5 304138414 287626396 316751748 328309608 308880258 342930301
|
||||
6000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
7000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
8000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
9000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
10000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
11000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
12000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
13000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
14000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
15000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
16000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
17000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
18000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
19000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
20000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
21000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
22000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
23000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
24000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
25000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
26000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
27000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
28000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
29000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
30000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
31000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
32000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
33000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
34000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
35000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
36000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
37000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
38000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
39000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
40000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
41000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
42000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
43000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
44000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
45000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
46000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
47000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
48000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
49000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
49
data/tags.d
Normal file
49
data/tags.d
Normal file
@ -0,0 +1,49 @@
|
||||
1000 46407.85 48260 92784.11 58359.75 60670 68427.51 111680.8 109784 123174.7 25046400 15183137 36056938 27331481 16031049 39393943
|
||||
2000 89709.68 99074 237722.20 126450.1 126126 140746.9 230099.4 214486 256065.0 55072766 35251506 67965873 59245033 33153668 73276433
|
||||
3000 177078.2 188430 483547.4 197813.5 197822 205526.1 267996.5 665748 1971332.7 86076812 107367277 97133916 92676826 116628552 104971483
|
||||
4000 308312.9 283972 616899.9 296982.2 267806 410745.1 402399.4 1743964 5861395.8 120162415 122719698 123856793 129777077 132449972 133784076
|
||||
5000 446012.6 406496 828497.7 21870.69 352976 1475242.73 140217.4 1768296 6998056.5 148184604 139245637 159136161 157187113 147782836 168681273
|
||||
6000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
7000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
8000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
9000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
10000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
11000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
12000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
13000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
14000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
15000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
16000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
17000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
18000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
19000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
20000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
21000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
22000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
23000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
24000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
25000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
26000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
27000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
28000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
29000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
30000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
31000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
32000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
33000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
34000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
35000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
36000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
37000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
38000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
39000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
40000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
41000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
42000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
43000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
44000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
45000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
46000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
47000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
48000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
49000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
71
paper/.source-highlight_groff-output-definition
Normal file
71
paper/.source-highlight_groff-output-definition
Normal file
@ -0,0 +1,71 @@
|
||||
extension "groff"
|
||||
doctemplate
|
||||
"
|
||||
.MT 0
|
||||
$header
|
||||
.TL
|
||||
$title
|
||||
.AU \"\"
|
||||
.ND
|
||||
.SA 0
|
||||
.DS I
|
||||
"
|
||||
".DE
|
||||
$footer
|
||||
"
|
||||
end
|
||||
|
||||
nodoctemplate
|
||||
"
|
||||
"
|
||||
"
|
||||
"
|
||||
end
|
||||
|
||||
bold "\f[CB]$text\fP"
|
||||
italics "\f[CI]$text\fP"
|
||||
underline "\f[CI]$text\fP"
|
||||
fixed "\fC$text\fP"
|
||||
color "\m[$style]$text\m[]"
|
||||
|
||||
anchor "$infilename : $linenum - $text"
|
||||
reference "$text \(-> $infile:$linenum, page : $infilename:$linenum"
|
||||
|
||||
#lineprefix "\fC\(em\fP "
|
||||
#lineprefix "\fC\n(ln\fP "
|
||||
|
||||
lineprefix ""
|
||||
|
||||
|
||||
colormap
|
||||
"green" "green"
|
||||
"red" "red"
|
||||
"darkred" "darkred"
|
||||
"blue" "blue"
|
||||
"brown" "brown"
|
||||
"pink" "pink"
|
||||
"yellow" "yellow"
|
||||
"cyan" "cyan"
|
||||
"purple" "purple"
|
||||
"orange" "orange"
|
||||
"brightorange" "brightorange"
|
||||
"brightgreen" "brightgreen"
|
||||
"darkgreen" "darkgreen"
|
||||
"black" "black"
|
||||
"teal" "teal"
|
||||
"gray" "gray"
|
||||
"darkblue" "darkblue"
|
||||
default "black"
|
||||
end
|
||||
|
||||
translations
|
||||
"\\" "\\\\"
|
||||
##"\n" " \\\\\n"
|
||||
##" " "\\ "
|
||||
##"\t" "\\ \\ \\ \\ \\ \\ \\ \\ "
|
||||
"\t" " "
|
||||
"|" "|"
|
||||
"---" "\(em"
|
||||
"--" "\(mi"
|
||||
end
|
||||
|
5
paper/Makefile
Normal file
5
paper/Makefile
Normal file
@ -0,0 +1,5 @@
|
||||
SRC ?= paper
|
||||
ODIR ?= /tmp/
|
||||
export ODIR SRC
|
||||
|
||||
include Makefile.in
|
79
paper/Makefile.in
Normal file
79
paper/Makefile.in
Normal file
@ -0,0 +1,79 @@
|
||||
SRC ?= graphs
|
||||
|
||||
ODIR ?= .
|
||||
|
||||
BIBLIOGRAPHY ?= bibliography
|
||||
ALLSRC = $(shell find .)
|
||||
|
||||
SOELIM_OPTS ?=
|
||||
SOELIM = soelim $(SOELIM_OPTS)
|
||||
|
||||
PRECONV_OPTS ?= -e utf-8
|
||||
PRECONV = preconv $(PRECONV_OPTS)
|
||||
|
||||
EQN_OPTS ?= -Tpdf
|
||||
EQN = eqn $(EQN_OPTS)
|
||||
|
||||
# source-highlight stuff
|
||||
# GH_INTRO: instructions before each source code provided by source-highlight
|
||||
# GH_OUTRO: ------------ after ---- ------ ---- -------- -- ----------------
|
||||
# GH_INTRO/GH_OUTRO: values are separated by ';'
|
||||
#
|
||||
GH_INTRO := .nr DI 0;.DS I;.fam C;.b1;.sp -0.1i
|
||||
GH_OUTRO := .sp -0.2i;.b2;.fam;.DE
|
||||
#
|
||||
export GH_INTRO
|
||||
export GH_OUTRO
|
||||
#
|
||||
# SHOPTS: cmd line parameter given to source-highlight
|
||||
SHOPTS = --outlang-def=.source-highlight_groff-output-definition
|
||||
export SHOPTS
|
||||
|
||||
# ghighlight brings `source-highlight` to troff
|
||||
GHIGHLIGHT_OPTS ?=
|
||||
GHIGHLIGHT = ./bin/ghighlight $(GHIGHLIGHT_OPTS)
|
||||
|
||||
GRAP_OPTS ?=
|
||||
GRAP = grap $(GRAP_OPTS)
|
||||
|
||||
PIC_OPTS ?= -Tpdf
|
||||
PIC = pic $(PIC_OPTS)
|
||||
|
||||
# -P => move ponctuation after reference
|
||||
# -S => label and bracket-label options
|
||||
# -e => accumulate (use a reference section)
|
||||
# -p bib => bibliography file
|
||||
REFER_OPTS ?= -PS -e -p $(BIBLIOGRAPHY)
|
||||
REFER = refer $(REFER_OPTS)
|
||||
|
||||
# -k => iconv conversion (did it ever worked?)
|
||||
# -ms => ms macro
|
||||
# -U => unsafe (because of PDF inclusion)
|
||||
# -Tpdf => output device is PDF
|
||||
# -mspdf => include PDF (so, images converted in PDF) in the document
|
||||
# NOTE: a custom troffrc (configuration file) is necessary on OpenBSD
|
||||
# to have correctly justified paragraphs. Otherwise, the default
|
||||
# configuration removes this possibility, for bullshit reasons. Sad.
|
||||
# -M dir => path to custom troffrc
|
||||
# TODO: no change with or without the following options -P -e
|
||||
# This has to be inverstigated: how to make PDFs look nice in browsers?
|
||||
# -P -e => provide "-e" to gropdf to embed fonts
|
||||
GROFF_OPTS ?= -ms -t -Tpdf -U -mspdf -mpdfmark -M ./bin -P -e
|
||||
GROFF = groff $(GROFF_OPTS)
|
||||
|
||||
$(SRC).pdf:
|
||||
$(SOELIM) < $(SRC).ms |\
|
||||
./bin/utf8-to-ms.sh |\
|
||||
$(PRECONV) |\
|
||||
$(EQN) |\
|
||||
$(GHIGHLIGHT) |\
|
||||
$(GRAP) |\
|
||||
$(PIC) |\
|
||||
$(REFER) |\
|
||||
$(GROFF) > $(ODIR)/$@
|
||||
|
||||
# Keep options in memory for the recursive 'make' call
|
||||
export SOELIM_OPTS PRECONV_OPTS EQN_OPTS GHIGHLIGHT_OPTS GRAP_OPTS PIC_OPTS REFER_OPTS
|
||||
serve:
|
||||
@#find . -name "*.ms" -or -name "*.d" | entr gmake -B $(SRC).pdf
|
||||
find . | entr gmake -B $(SRC).pdf
|
24
paper/bibliography
Normal file
24
paper/bibliography
Normal file
@ -0,0 +1,24 @@
|
||||
%K CBOR
|
||||
%A C. Bormann
|
||||
%A P. Hoffman
|
||||
%T RFC 8949, Concise Binary Object Representation (CBOR)
|
||||
%D 2020
|
||||
%I Internet Engineering Task Force (IETF)
|
||||
|
||||
%K JSON
|
||||
%A Tim Bray
|
||||
%T RFC 8259, The JavaScript Object Notation (JSON) Data Interchange Format
|
||||
%D 2017
|
||||
%I Internet Engineering Task Force (IETF)
|
||||
|
||||
%K darkhttpd
|
||||
%A Emil Mikulic
|
||||
%T DarkHTTPd, when you need a webserver in a hurry.
|
||||
%D 2017
|
||||
%I https://unix4lyfe.org/darkhttpd/
|
||||
|
||||
%K netlibre
|
||||
%A Philippe PITTOLI
|
||||
%T netlib.re, a free DNS registrar
|
||||
%D 2013
|
||||
%I https://www.netlib.re
|
46
paper/graphs/addition_lru.grap
Normal file
46
paper/graphs/addition_lru.grap
Normal file
@ -0,0 +1,46 @@
|
||||
.G1
|
||||
copy "legend.grap"
|
||||
frame invis ht 3 wid 4 left solid bot solid
|
||||
coord x 0,100000
|
||||
|
||||
label left "Cost of adding" unaligned "a new entry (ns)" left 0.8
|
||||
label bot "Number of entries already in the structure" down 0.1
|
||||
|
||||
oblru = obefficientlru = 0
|
||||
cblru = cbefficientlru = 0
|
||||
|
||||
legendxleft = 1000
|
||||
legendxright = 50000
|
||||
legendyup = 190000
|
||||
legendydown = 140000
|
||||
|
||||
boite(legendxleft,legendxright,legendyup,legendydown)
|
||||
legend_lru_addition(legendxleft,legendxright,legendyup,legendydown)
|
||||
|
||||
copy "../data/lru_100000_100000_redux.d" thru X
|
||||
cx = $1
|
||||
|
||||
cblru = $2
|
||||
cbefficientlru = $3
|
||||
|
||||
# lru efficientlru
|
||||
.gcolor orange
|
||||
if (oblru > 0) then {line from cx,cblru to ox,oblru}
|
||||
.gcolor
|
||||
.gcolor green
|
||||
if (obefficientlru > 0) then {line from cx,cbefficientlru to ox,obefficientlru}
|
||||
.gcolor
|
||||
|
||||
oblru = cblru
|
||||
obefficientlru = cbefficientlru
|
||||
ox = cx
|
||||
|
||||
# lru efficientlru
|
||||
.gcolor orange
|
||||
bullet at cx,cblru
|
||||
.gcolor
|
||||
.gcolor green
|
||||
bullet at cx,cbefficientlru
|
||||
.gcolor
|
||||
X
|
||||
.G2
|
71
paper/graphs/lru_query_index.grap
Normal file
71
paper/graphs/lru_query_index.grap
Normal file
@ -0,0 +1,71 @@
|
||||
.G1
|
||||
copy "legend.grap"
|
||||
frame invis ht 3 wid 4 left solid bot solid
|
||||
coord y 0,300
|
||||
ticks left out from 0 to 300 by 50
|
||||
ticks bot out at 50000 "50,000", 100000 "100,000", 150000 "150,000", 200000 "200,000", 250000 "250,000"
|
||||
|
||||
label left "Request duration with" unaligned "an index (ns)" "(Median)" left 0.8
|
||||
label bot "Number of cars in the database" down 0.1
|
||||
|
||||
oblru1 = oblru5 = oblru10 = oblru20 = 0 # old bullets
|
||||
cblru1 = cblru5 = cblru10 = cblru20 = 0 # current bullets
|
||||
|
||||
legendxleft = 120000
|
||||
legendxright = 180000
|
||||
legendyup = 120
|
||||
legendydown = 20
|
||||
|
||||
boite(legendxleft,legendxright,legendyup,legendydown)
|
||||
legend_common(legendxleft,legendxright,legendyup,legendydown)
|
||||
|
||||
copy "../data/lru_index.d" thru X
|
||||
cx = $1*5
|
||||
|
||||
y_scale = 1
|
||||
|
||||
## lru1 lru5 lru10 lru20
|
||||
#line from cx,$2/y_scale to cx,$4/y_scale
|
||||
#line from cx,$5/y_scale to cx,$7/y_scale
|
||||
#line from cx,$8/y_scale to cx,$10/y_scale
|
||||
#line from cx,$11/y_scale to cx,$13/y_scale
|
||||
|
||||
#ty = $3
|
||||
|
||||
cx = $1*5
|
||||
|
||||
cblru1 = $3/y_scale
|
||||
cblru5 = $6/y_scale
|
||||
cblru10 = $9/y_scale
|
||||
cblru20 = $12/y_scale
|
||||
|
||||
.gcolor red
|
||||
if (oblru1 > 0) then {line from cx,cblru1 to ox,oblru1}
|
||||
.gcolor
|
||||
.gcolor green
|
||||
if (oblru5 > 0) then {line from cx,cblru5 to ox,oblru5}
|
||||
.gcolor
|
||||
if (oblru10 > 0) then {line from cx,cblru10 to ox,oblru10}
|
||||
.gcolor pink
|
||||
if (oblru20 > 0) then {line from cx,cblru20 to ox,oblru20}
|
||||
.gcolor
|
||||
|
||||
oblru1 = cblru1
|
||||
oblru5 = cblru5
|
||||
oblru10 = cblru10
|
||||
oblru20 = cblru20
|
||||
ox = cx
|
||||
|
||||
# lru1 lru5 lru10 lru20
|
||||
.gcolor red
|
||||
bullet at cx,cblru1
|
||||
.gcolor
|
||||
.gcolor green
|
||||
bullet at cx,cblru5
|
||||
.gcolor
|
||||
bullet at cx,cblru10
|
||||
.gcolor pink
|
||||
bullet at cx,cblru20
|
||||
.gcolor
|
||||
X
|
||||
.G2
|
38
paper/graphs/lru_query_partition.grap
Normal file
38
paper/graphs/lru_query_partition.grap
Normal file
@ -0,0 +1,38 @@
|
||||
.G1
|
||||
copy "legend.grap"
|
||||
frame invis ht 3 wid 4 left solid bot solid
|
||||
coord x 0,5000*2 y 0,4000
|
||||
ticks left out from 0 to 4000 by 400
|
||||
ticks bot out from 1000 to 10000 by 1000
|
||||
|
||||
label left "Request duration" unaligned "for a partition (µs)" "(Median)" left 0.8
|
||||
label bot "Number of cars matching the partition" down 0.1
|
||||
|
||||
oblru1 = oblru5 = oblru10 = oblru20 = 0
|
||||
cblru1 = cblru5 = cblru10 = cblru20 = 0
|
||||
|
||||
legendxleft = 1000
|
||||
legendxright = 2500
|
||||
legendyup = 4000
|
||||
legendydown = 2500
|
||||
|
||||
boite(legendxleft,legendxright,legendyup,legendydown)
|
||||
legend_common(legendxleft,legendxright,legendyup,legendydown)
|
||||
|
||||
copy "../data/lru_partitions.d" thru X
|
||||
cx = $1*2
|
||||
|
||||
y_scale = 1000
|
||||
|
||||
# Since the first access to the data is massively slower than the
|
||||
# following retrivials, the mustache doesn't provide a better
|
||||
# understanding of the data.
|
||||
|
||||
line_no_mustache(cblru1, oblru1, $3, red)
|
||||
line_no_mustache(cblru5, oblru5, $6, green)
|
||||
line_no_mustache(cblru10, oblru10, $9, black)
|
||||
line_no_mustache(cblru20, oblru20, $12, pink)
|
||||
|
||||
ox = cx
|
||||
X
|
||||
.G2
|
37
paper/graphs/lru_query_tag.grap
Normal file
37
paper/graphs/lru_query_tag.grap
Normal file
@ -0,0 +1,37 @@
|
||||
.G1
|
||||
copy "legend.grap"
|
||||
frame invis ht 3 wid 4 left solid bot solid
|
||||
coord x 0,5000 y 0,3000
|
||||
ticks left out from 0 to 5000 by 200
|
||||
ticks bot out from 1000 to 5000 by 1000
|
||||
label left "Request duration" unaligned "for a tag (µs)" "(Median)" left 0.8
|
||||
label bot "Number of cars matching the tag" down 0.1
|
||||
|
||||
oblru1 = oblru5 = oblru10 = oblru20 = 0
|
||||
cblru1 = cblru5 = cblru10 = cblru20 = 0
|
||||
|
||||
legendxleft = 2000
|
||||
legendxright = 3500
|
||||
legendyup = 2500
|
||||
legendydown = 1500
|
||||
|
||||
boite(legendxleft,legendxright,legendyup,legendydown)
|
||||
legend_common(legendxleft,legendxright,legendyup,legendydown)
|
||||
|
||||
copy "../data/lru_tags.d" thru X
|
||||
cx = $1
|
||||
|
||||
y_scale = 1000
|
||||
|
||||
# Since the first access to the data is massively slower than the
|
||||
# following retrivials, the mustache doesn't provide a better
|
||||
# understanding of the data.
|
||||
|
||||
line_no_mustache(cblru1, oblru1, $3, red)
|
||||
line_no_mustache(cblru5, oblru5, $6, green)
|
||||
line_no_mustache(cblru10, oblru10, $9, black)
|
||||
line_no_mustache(cblru20, oblru20, $12, pink)
|
||||
|
||||
ox = cx
|
||||
X
|
||||
.G2
|
64
paper/graphs/query_index.grap
Normal file
64
paper/graphs/query_index.grap
Normal file
@ -0,0 +1,64 @@
|
||||
.G1
|
||||
copy "legend.grap"
|
||||
|
||||
graph Linear
|
||||
frame invis ht 3 wid 4 left solid bot solid
|
||||
coord y 0,40000
|
||||
ticks left out from 0 to 40000 by 10000
|
||||
ticks bot off
|
||||
|
||||
label left "Request duration with" unaligned "an index (ns)" "(Median)" left 0.8
|
||||
label right "\s+2Linear" unaligned "scale\s0"
|
||||
|
||||
obram = obuncache = obcache = oblru = obsemi = 0 # old bullets
|
||||
cbram = cbuncache = cbcache = cblru = cbsemi = 0 # current bullets
|
||||
|
||||
legendxleft = 100000
|
||||
legendxright = 250000
|
||||
legendyup = 15000
|
||||
legendydown = 2000
|
||||
|
||||
boite(legendxleft,legendxright,legendyup,legendydown)
|
||||
legend(legendxleft,legendxright,legendyup,legendydown)
|
||||
|
||||
copy "../data/index.d" thru X
|
||||
cx = $1*5
|
||||
|
||||
y_scale = 1
|
||||
|
||||
line_no_mustache(cbram, obram, $3, red)
|
||||
line_no_mustache(cbcache, obcache, $6, black)
|
||||
line_no_mustache(cblru, oblru, $9, pink)
|
||||
line_no_mustache(cbsemi, obsemi, $12, blue)
|
||||
line_no_mustache(cbuncache, obuncache, $15, green)
|
||||
|
||||
ox = cx
|
||||
X
|
||||
|
||||
graph Exponential with .Frame.n at Linear.Frame.s -(0,.05)
|
||||
frame invis ht 3 wid 4 left solid bot solid
|
||||
coord log y
|
||||
#ticks left out from 0 to 50 by 10
|
||||
ticks bot out at 50000 "50,000", 100000 "100,000", 150000 "150,000", 200000 "200,000", 250000 "250,000"
|
||||
|
||||
label left "Request duration with" unaligned "an index (ns)" "(Median)" left 0.8
|
||||
label bot "Number of cars in the database" down 0.1
|
||||
label right "\s+2Logarithmic" unaligned "scale\s0"
|
||||
|
||||
obram = obuncache = obcache = oblru = obsemi = 0 # old bullets
|
||||
cbram = cbuncache = cbcache = cblru = cbsemi = 0 # current bullets
|
||||
|
||||
copy "../data/index.d" thru X
|
||||
cx = $1*5
|
||||
|
||||
y_scale = 1
|
||||
|
||||
line_no_mustache(cbram, obram, $3, red)
|
||||
line_no_mustache(cbcache, obcache, $6, black)
|
||||
line_no_mustache(cblru, oblru, $9, pink)
|
||||
line_no_mustache(cbsemi, obsemi, $12, blue)
|
||||
line_no_mustache(cbuncache, obuncache, $15, green)
|
||||
|
||||
ox = cx
|
||||
X
|
||||
.G2
|
86
paper/graphs/query_partition.grap
Normal file
86
paper/graphs/query_partition.grap
Normal file
@ -0,0 +1,86 @@
|
||||
.G1
|
||||
copy "legend.grap"
|
||||
|
||||
graph Linear
|
||||
frame invis ht 3 wid 4 left solid bot solid
|
||||
coord x 0,5000*2
|
||||
ticks bot off
|
||||
|
||||
label left "Request duration" unaligned "for a partition (ms)" "(Median)" left 0.8
|
||||
label right "\s+2Linear" unaligned "scale\s0"
|
||||
|
||||
obram = obuncache = oblru = obcache = obsemi = 0
|
||||
cbram = cbuncache = cblru = cbcache = cbsemi = 0
|
||||
|
||||
legendxleft = 1000
|
||||
legendxright = 6500
|
||||
legendyup = 320
|
||||
legendydown = 220
|
||||
|
||||
boite(legendxleft,legendxright,legendyup,legendydown)
|
||||
legend(legendxleft,legendxright,legendyup,legendydown)
|
||||
|
||||
y_scale = 1000000
|
||||
|
||||
linear_growth(red, 110, 1000, 10000)
|
||||
linear_growth(black, 110, 1000, 10000)
|
||||
linear_growth(pink, 160, 1000, 10000)
|
||||
linear_growth(blue, 13982, 1000, 10000)
|
||||
linear_growth(green, 17350, 1000, 10000)
|
||||
|
||||
copy "../data/partitions.d" thru X
|
||||
cx = $1*2
|
||||
|
||||
line_no_mustache(cbram, obram, $3, red)
|
||||
line_no_mustache(cbcache, obcache, $6, black)
|
||||
line_no_mustache(cblru, oblru, $9, pink)
|
||||
line_no_mustache(cbsemi, obsemi, $12, blue)
|
||||
line_no_mustache(cbuncache, obuncache, $15, green)
|
||||
|
||||
#line_with_mustache(cbram, obram, $3, red, $2, $4)
|
||||
#line_with_mustache(cbcache, obcache, $6, black, $5, $7)
|
||||
#line_with_mustache(cblru, oblru, $9, pink, $8, $10)
|
||||
#line_with_mustache(cbsemi, obsemi, $12,blue, $11, $13)
|
||||
#line_with_mustache(cbuncache,obuncache,$15,green, $14, $16)
|
||||
|
||||
ox = cx
|
||||
X
|
||||
|
||||
graph Exponential with .Frame.n at Linear.Frame.s -(0,.05)
|
||||
frame invis ht 3 wid 4 left solid bot solid
|
||||
coord x 0,5000*2 y 0.05,350 log y
|
||||
ticks bot out from 1000 to 10000 by 1000
|
||||
|
||||
label left "Request duration" unaligned "for a partition (ms)" "(Median)" left 0.8
|
||||
label bot "Number of cars matching the partition" down 0.1
|
||||
label right "\s+2Logarithmic" unaligned "scale\s0"
|
||||
|
||||
obram = obuncache = oblru = obcache = obsemi = 0
|
||||
cbram = cbuncache = cblru = cbcache = cbsemi = 0
|
||||
|
||||
y_scale = 1000000
|
||||
|
||||
linear_growth(red, 85, 1000, 10000)
|
||||
linear_growth(black, 85, 1000, 10000)
|
||||
linear_growth(pink, 160, 1000, 10000)
|
||||
linear_growth(blue, 13982, 1000, 10000)
|
||||
linear_growth(green, 17350, 1000, 10000)
|
||||
|
||||
copy "../data/partitions.d" thru X
|
||||
cx = $1*2
|
||||
|
||||
line_no_mustache(cbram, obram, $3, red)
|
||||
line_no_mustache(cbcache, obcache, $6, black)
|
||||
line_no_mustache(cblru, oblru, $9, pink)
|
||||
line_no_mustache(cbsemi, obsemi, $12, blue)
|
||||
line_no_mustache(cbuncache, obuncache, $15, green)
|
||||
|
||||
#line_with_mustache(cbram, obram, $3, red, $2, $4)
|
||||
#line_with_mustache(cbcache, obcache, $6, black, $5, $7)
|
||||
#line_with_mustache(cblru, oblru, $9, pink, $8, $10)
|
||||
#line_with_mustache(cbsemi, obsemi, $12,blue, $11, $13)
|
||||
#line_with_mustache(cbuncache,obuncache,$15,green, $14, $16)
|
||||
|
||||
ox = cx
|
||||
X
|
||||
.G2
|
75
paper/graphs/query_tag.grap
Normal file
75
paper/graphs/query_tag.grap
Normal file
@ -0,0 +1,75 @@
|
||||
.G1
|
||||
copy "legend.grap"
|
||||
|
||||
graph Linear
|
||||
frame invis ht 3 wid 4 left solid bot solid
|
||||
coord x 0,5000 y 0,170
|
||||
ticks left out from 0 to 170 by 20
|
||||
ticks bot off
|
||||
label left "Request duration" unaligned "for a tag (ms)" "(Median)" left 0.8
|
||||
#label bot "Number of cars matching the tag" down 0.1
|
||||
label right "\s+2Linear" unaligned "scale\s0"
|
||||
|
||||
obram = obuncache = oblru = obcache = obsemi = 0
|
||||
cbram = cbuncache = cblru = cbcache = cbsemi = 0
|
||||
|
||||
legendxleft = 200
|
||||
legendxright = 3000
|
||||
legendyup = 170
|
||||
legendydown = 120
|
||||
|
||||
boite(legendxleft,legendxright,legendyup,legendydown)
|
||||
legend(legendxleft,legendxright,legendyup,legendydown)
|
||||
|
||||
copy "../data/tags.d" thru X
|
||||
cx = $1
|
||||
|
||||
y_scale = 1000000
|
||||
|
||||
line_no_mustache(cbram, obram, $3, red)
|
||||
line_no_mustache(cbcache, obcache, $6, black)
|
||||
line_no_mustache(cblru, oblru, $9, pink)
|
||||
line_no_mustache(cbsemi, obsemi, $12, blue)
|
||||
line_no_mustache(cbuncache, obuncache, $15, green)
|
||||
|
||||
#line_with_mustache(cbram, obram, $3, red, $2, $4)
|
||||
#line_with_mustache(cbcache, obcache, $6, black, $5, $7)
|
||||
#line_with_mustache(cblru, oblru, $9, pink, $8, $10)
|
||||
#line_with_mustache(cbsemi, obsemi, $12,blue, $11, $13)
|
||||
#line_with_mustache(cbuncache,obuncache,$15,green, $14, $16)
|
||||
|
||||
ox = cx
|
||||
X
|
||||
|
||||
graph Exponential with .Frame.n at Linear.Frame.s -(0,.05)
|
||||
frame invis ht 3 wid 4 left solid bot solid
|
||||
coord x 0,5000 y 0.02,350 log y
|
||||
ticks bot out from 1000 to 5000 by 1000
|
||||
|
||||
label left "Request duration" unaligned "for a tag (ms)" "(Median)" left 0.8
|
||||
label bot "Number of cars matching the tag" down 0.1
|
||||
label right "\s+2Logarithmic" unaligned "scale\s0"
|
||||
|
||||
obram = obuncache = oblru = obcache = obsemi = 0
|
||||
cbram = cbuncache = cblru = cbcache = cbsemi = 0
|
||||
|
||||
copy "../data/tags.d" thru X
|
||||
cx = $1
|
||||
|
||||
y_scale = 1000000
|
||||
|
||||
line_no_mustache(cbram, obram, $3, red)
|
||||
line_no_mustache(cbcache, obcache, $6, black)
|
||||
line_no_mustache(cblru, oblru, $9, pink)
|
||||
line_no_mustache(cbsemi, obsemi, $12, blue)
|
||||
line_no_mustache(cbuncache, obuncache, $15, green)
|
||||
|
||||
#line_with_mustache(cbram, obram, $3, red, $2, $4)
|
||||
#line_with_mustache(cbcache, obcache, $6, black, $5, $7)
|
||||
#line_with_mustache(cblru, oblru, $9, pink, $8, $10)
|
||||
#line_with_mustache(cbsemi, obsemi, $12,blue, $11, $13)
|
||||
#line_with_mustache(cbuncache,obuncache,$15,green, $14, $16)
|
||||
|
||||
ox = cx
|
||||
X
|
||||
.G2
|
145
paper/legend.grap
Normal file
145
paper/legend.grap
Normal file
@ -0,0 +1,145 @@
|
||||
define boite {
|
||||
xleft = $1
|
||||
xright = $2
|
||||
yup = $3
|
||||
ydown = $4
|
||||
|
||||
line from xleft,ydown to xright,ydown
|
||||
line from xleft,yup to xright,yup
|
||||
line from xleft,yup to xleft,ydown
|
||||
line from xright,yup to xright,ydown
|
||||
}
|
||||
|
||||
define legend_line {
|
||||
cy = $1
|
||||
lstartx = $2
|
||||
lendx = $3
|
||||
tstartx = $4
|
||||
|
||||
.gcolor $5
|
||||
line from lstartx,cy to lendx,cy
|
||||
.gcolor
|
||||
$6 ljust at tstartx,cy
|
||||
}
|
||||
|
||||
define legend {
|
||||
xleft = $1
|
||||
xright = $2
|
||||
yup = $3
|
||||
ydown = $4
|
||||
|
||||
diffx = xright - xleft
|
||||
diffy = yup - ydown
|
||||
|
||||
hdiff = diffy/5.7
|
||||
cy = yup - (diffy/6)
|
||||
cx = (diffx/20) + xleft
|
||||
|
||||
lstartx = cx
|
||||
lendx = cx + diffx/8
|
||||
tstartx = lendx + diffx/20
|
||||
|
||||
.ps -2
|
||||
legend_line(cy,lstartx,lendx,tstartx,red,"RAM only")
|
||||
cy = cy - hdiff
|
||||
legend_line(cy,lstartx,lendx,tstartx,black,"Cached db and index")
|
||||
cy = cy - hdiff
|
||||
legend_line(cy,lstartx,lendx,tstartx,pink,"Common db, cached index")
|
||||
cy = cy - hdiff
|
||||
legend_line(cy,lstartx,lendx,tstartx,blue,"Uncached db, cached index")
|
||||
cy = cy - hdiff
|
||||
legend_line(cy,lstartx,lendx,tstartx,green,"Uncached db and index")
|
||||
.ps +2
|
||||
}
|
||||
|
||||
define legend_common {
|
||||
xleft = $1
|
||||
xright = $2
|
||||
yup = $3
|
||||
ydown = $4
|
||||
|
||||
diffx = xright - xleft
|
||||
diffy = yup - ydown
|
||||
|
||||
hdiff = diffy/4.5
|
||||
cy = yup - (diffy/6)
|
||||
cx = (diffx/20) + xleft
|
||||
|
||||
lstartx = cx
|
||||
lendx = cx + diffx/8
|
||||
tstartx = lendx + diffx/20
|
||||
|
||||
.ps -2
|
||||
legend_line(cy,lstartx,lendx,tstartx,red,"1k")
|
||||
cy = cy - hdiff
|
||||
legend_line(cy,lstartx,lendx,tstartx,green,"5k")
|
||||
cy = cy - hdiff
|
||||
legend_line(cy,lstartx,lendx,tstartx,black,"10k")
|
||||
cy = cy - hdiff
|
||||
legend_line(cy,lstartx,lendx,tstartx,pink,"20k")
|
||||
.ps +2
|
||||
}
|
||||
|
||||
define legend_lru_addition {
|
||||
xleft = $1
|
||||
xright = $2
|
||||
yup = $3
|
||||
ydown = $4
|
||||
|
||||
diffx = xright - xleft
|
||||
diffy = yup - ydown
|
||||
|
||||
hdiff = diffy/3.5
|
||||
cy = yup - (diffy/10)
|
||||
cx = (diffx/20) + xleft
|
||||
|
||||
lstartx = cx
|
||||
lendx = cx + diffx/8
|
||||
tstartx = lendx + diffx/20
|
||||
|
||||
.ps -2
|
||||
cy = cy - hdiff
|
||||
legend_line(cy,lstartx,lendx,tstartx,orange,"Basic LRU")
|
||||
cy = cy - hdiff
|
||||
legend_line(cy,lstartx,lendx,tstartx,green,"Efficient LRU")
|
||||
.ps +2
|
||||
}
|
||||
|
||||
# WARNING: this macro uses "cx" (current x), y_scale and "ox" (old x).
|
||||
define line_no_mustache {
|
||||
# $1 = cbram
|
||||
# $2 = obram
|
||||
# $3 = column
|
||||
# $4 = color
|
||||
|
||||
$1 = $3/y_scale
|
||||
.gcolor $4
|
||||
if ($2 > 0) then {line from cx,$1 to ox,$2}
|
||||
bullet at cx,$1
|
||||
.gcolor
|
||||
$2 = $1
|
||||
}
|
||||
|
||||
# WARNING: this macro uses "cx" (current x), y_scale and "ox" (old x).
|
||||
define line_with_mustache {
|
||||
# $1 = cbram
|
||||
# $2 = obram
|
||||
# $3 = column
|
||||
# $4 = color
|
||||
# $5 = column mustache 1
|
||||
# $6 = column mustache 2
|
||||
|
||||
line_no_mustache($1,$2,$3,$4)
|
||||
line from cx,$5/y_scale to cx,$6/y_scale
|
||||
}
|
||||
|
||||
# WARNING: this macro y_scale.
|
||||
define linear_growth {
|
||||
# $1 = color
|
||||
# $2 = duration of the retrieval for a single value
|
||||
# $3 = min number of retrievals
|
||||
# $4 = max number of retrievals
|
||||
.gcolor $1
|
||||
line dashed from $3,($2*$3)/y_scale to $4,($2*$4)/y_scale
|
||||
.gcolor
|
||||
}
|
631
paper/macros.roff
Normal file
631
paper/macros.roff
Normal file
@ -0,0 +1,631 @@
|
||||
.\" .RP = report document
|
||||
.nr PO 0.5i \" page offset default 1i
|
||||
.nr LL 7.0i \" line length default 6i
|
||||
.nr FM 0.3i \" page foot margin default 1i
|
||||
.nr DI 0
|
||||
.nr FF 3 \" footnotes' type: numbered, with point, indented
|
||||
.nr PS 12
|
||||
.
|
||||
.nr LIST_NUMBER 0 +1
|
||||
.
|
||||
.R1
|
||||
no-label-in-reference
|
||||
accumulate
|
||||
.R2
|
||||
.
|
||||
. \" COLORS
|
||||
.defcolor darkgreen rgb 0.1 0.5 0.2
|
||||
.defcolor darkblue rgb 0.3 0.3 0.7
|
||||
.defcolor darkred rgb 0.7 0.3 0.3
|
||||
.defcolor black rgb 0 0 0
|
||||
.defcolor color_box rgb 1 1 .6
|
||||
.
|
||||
. \" with semantic
|
||||
.defcolor citation rgb 0.4 0.4 0.4
|
||||
.defcolor citationbar rgb 0.3 0.3 0.7
|
||||
.defcolor explanation rgb 0.7 0.4 0.4
|
||||
.defcolor explanationbar rgb 0.8 0.3 0.3
|
||||
.
|
||||
.defcolor specialcolor_command rgb 0.7 0.3 0.3
|
||||
.defcolor specialcolor_type rgb 0.6 0.3 0.5
|
||||
.defcolor specialcolor_constructor rgb 0.1 0.5 0.2
|
||||
.defcolor specialcolor_module rgb 0.1 0.5 0.2
|
||||
.defcolor specialcolor_function rgb 0.4 0.4 0.7
|
||||
.defcolor specialcolor_question rgb 0.0 0.0 0.7
|
||||
.defcolor specialcolor_operator rgb 0.3 0.8 0.3
|
||||
.defcolor specialcolor_shine rgb 0.3 0.3 0.7
|
||||
.
|
||||
. \" SIZES
|
||||
.nr specialsize_command 10
|
||||
.nr specialsize_type 8
|
||||
.nr specialsize_constructor 8
|
||||
.nr specialsize_module 8
|
||||
.nr specialsize_function 8
|
||||
.nr specialsize_operator 9
|
||||
.nr specialsize_question 10 \" Current point size, no change.
|
||||
.nr specialsize_shine 11
|
||||
.
|
||||
. \" FONTS
|
||||
.ds specialfont_command CW
|
||||
.ds specialfont_type CW
|
||||
.ds specialfont_constructor CW
|
||||
.ds specialfont_module CW
|
||||
.ds specialfont_function CW
|
||||
.ds specialfont_operator CW
|
||||
.ds specialfont_question I
|
||||
.ds specialfont_shine B
|
||||
.
|
||||
.
|
||||
.de BELLOWEXPLANATION1
|
||||
.sp 0.5
|
||||
.ps 7 \" point size (~= font size)
|
||||
.vs 8p \" vertical spacing between lines
|
||||
..
|
||||
.de BELLOWEXPLANATION2
|
||||
.br
|
||||
.ps 9
|
||||
.vs 11p
|
||||
..
|
||||
.
|
||||
.\" BULLET and ENUM => do not add space when no parameter are provided
|
||||
.de STARTBULLET \" Bullet points
|
||||
.in +1
|
||||
..
|
||||
.de BULLET \" Bullet points
|
||||
.in -1
|
||||
\(bu
|
||||
.in +1
|
||||
.sp -1
|
||||
.ie '\\$1'' \
|
||||
.
|
||||
.el \\$*
|
||||
..
|
||||
.de ENDBULLET
|
||||
.in -1 \" indent
|
||||
..
|
||||
.
|
||||
.de ENUM \" Numbered list
|
||||
.nr LIST_NUMBER +1
|
||||
.IP \\n[LIST_NUMBER]. 3
|
||||
.sp -1
|
||||
.ie '\\$1'' \
|
||||
.
|
||||
.el \\$*
|
||||
..
|
||||
.de ENDENUM
|
||||
.nr LIST_NUMBER 0
|
||||
.in -2 \" indent
|
||||
..
|
||||
.
|
||||
.de b1 \" Begin code box
|
||||
.B1
|
||||
.sp 0.2
|
||||
.ft CW
|
||||
..
|
||||
.de b2 \" End code box
|
||||
.sp 0.5
|
||||
.B2
|
||||
.ft
|
||||
..
|
||||
.
|
||||
.de CITATION1
|
||||
.KS \" start a keep
|
||||
.ft I \" citation in italics
|
||||
.mk C \" set a marker for line drawing
|
||||
.in +1 \" indent a bit
|
||||
.gcolor citation
|
||||
..
|
||||
.ig
|
||||
The CITATION2 macro closes the quote then draws a line
|
||||
from current line to the start of the quote.
|
||||
..
|
||||
.de CITATION2
|
||||
.mk D \" set second marker to come back here
|
||||
.ft \" back to previous font
|
||||
.in -1 \" remove indent
|
||||
.gcolor \" remove previous color
|
||||
.gcolor citationbar
|
||||
.\" r = move upward
|
||||
.\" Z D t = drawing thickness
|
||||
.\" L = draw the line
|
||||
\r\
|
||||
\Z'\D't 1p''\
|
||||
\L'|\\nCu' \" draw line
|
||||
.gcolor black \" remove previous color
|
||||
.sp -2 \" get two lines back
|
||||
\Z'\D't 1'' \" get the previous drawing thickness back
|
||||
.KE \" end of the keep
|
||||
..
|
||||
.
|
||||
.de NAMECITATION
|
||||
.QP
|
||||
.vs -\\n[legendps]p
|
||||
.ps -\\n[legendps]
|
||||
.in -1.2
|
||||
.ll +1.2
|
||||
\h'|-2'\(em\h'|-0.4'
|
||||
\\$*
|
||||
.br
|
||||
.LP
|
||||
..
|
||||
.
|
||||
.de EXPLANATION1
|
||||
.KS \" start a keep
|
||||
.ft B \" citation in italics
|
||||
.mk C \" set a marker for line drawing
|
||||
.in +1 \" indent a bit
|
||||
.gcolor explanation
|
||||
..
|
||||
.de EXPLANATION2
|
||||
.ft \" back to previous font
|
||||
.in -1 \" remove indent
|
||||
.gcolor \" remove previous color
|
||||
.gcolor explanationbar
|
||||
\r\L'|\\nCu' \" draw line (\r moves upward, \L draw the line, ...)
|
||||
.gcolor \" remove previous color
|
||||
.sp -1 \" get two lines back
|
||||
.KE \" end of the keep
|
||||
..
|
||||
.
|
||||
.de METAINFO1
|
||||
.ft CW \" constant width font
|
||||
.ps 8 \" small font
|
||||
.vs 9p \" smaller vertical spacing between lines
|
||||
..
|
||||
.de METAINFO2
|
||||
.sp 1
|
||||
.vs \" come back to the previous vertical spacing
|
||||
.ps \" come back to the previous point size
|
||||
.ft \" come back to the previous font
|
||||
.sp -1 \" return one line above
|
||||
..
|
||||
.
|
||||
.
|
||||
.de FRAC
|
||||
.ie '\\$3'' \{\
|
||||
\v'-.7m\s[\\n(.s*6u/10u]+.7m'\\$1\v'-.7m\s0+.7m'\
|
||||
\(f/\s[\\n(.s*6u/10u]\\$2\s0
|
||||
\}
|
||||
.el \{\
|
||||
\v'-.7m\s[\\n(.s*6u/10u]+.7m'\\$1\v'-.7m\s0+.7m'\
|
||||
\(f/\s[\\n(.s*6u/10u]\\$2\s0\\$3
|
||||
\}
|
||||
..
|
||||
.de FOOTNOTE_TO_COLUMN_WIDTH
|
||||
.nr pg@fn-colw \\n[pg@colw] \" footnotes' column width
|
||||
..
|
||||
.de SINGLE_COLUMN
|
||||
.1C
|
||||
.\" .FOOTNOTE_TO_COLUMN_WIDTH
|
||||
.nr FL (\n[LL]*97/100)
|
||||
..
|
||||
.de TWO_COLUMNS
|
||||
.2C
|
||||
.FOOTNOTE_TO_COLUMN_WIDTH
|
||||
..
|
||||
.de HORIZONTALLINE
|
||||
\l'15'
|
||||
.FOOTNOTE_TO_COLUMN_WIDTH
|
||||
..
|
||||
.
|
||||
. \" Fonts and colors.
|
||||
.
|
||||
.de SPECIAL_WORDS
|
||||
.ie !'\\$3'' \\$3\c
|
||||
.nr current_size \\n[.s] \" Current point size.
|
||||
.gcolor specialcolor_\\*[semantictoken]
|
||||
.
|
||||
.if !((\\n[current_size] == \\n[specialsize_\\*[semantictoken]]) \
|
||||
.ps \\n[specialsize_\\*[semantictoken]]
|
||||
.
|
||||
.ie '\\$2'' \{\
|
||||
\f[\\*[specialfont_\\*[semantictoken]]]\\$1\f[]
|
||||
. ps \\n[current_size]
|
||||
. gcolor black \" FIXME: should be the previous color
|
||||
\}
|
||||
.el \{\
|
||||
\f[\\*[specialfont_\\*[semantictoken]]]\\$1\f[]\c
|
||||
. ps \\n[current_size]
|
||||
. gcolor black \" FIXME: should be the previous color
|
||||
\\$2
|
||||
\}
|
||||
..
|
||||
.de SMALLFONT
|
||||
.ps 8
|
||||
.vs 9p
|
||||
..
|
||||
.de NORMALFONT
|
||||
.vs
|
||||
.ps
|
||||
..
|
||||
.de COMMAND1
|
||||
.b1
|
||||
..
|
||||
.de COMMAND2
|
||||
.b2
|
||||
..
|
||||
.de COMMANDNAME
|
||||
.ds semantictoken command
|
||||
.SPECIAL_WORDS \\$@
|
||||
..
|
||||
.de FUNCTION
|
||||
.ds semantictoken function
|
||||
.SPECIAL_WORDS \\$@
|
||||
..
|
||||
.de TYPE
|
||||
.ds semantictoken type
|
||||
.SPECIAL_WORDS \\$@
|
||||
..
|
||||
.de TYPECLASS
|
||||
.I "\\$1" "\\$2"
|
||||
..
|
||||
.de OPERATOR
|
||||
.ds semantictoken operator
|
||||
.SPECIAL_WORDS \\$@
|
||||
..
|
||||
.de QUESTION
|
||||
.ds semantictoken question
|
||||
.SPECIAL_WORDS \\$@
|
||||
\h'5p'
|
||||
..
|
||||
.de CONSTRUCTOR
|
||||
.ds semantictoken constructor
|
||||
.SPECIAL_WORDS \\$@
|
||||
..
|
||||
.de MODULE
|
||||
.ds semantictoken module
|
||||
.SPECIAL_WORDS \\$@
|
||||
..
|
||||
.de SHINE
|
||||
.ds semantictoken shine
|
||||
.SPECIAL_WORDS \\$@
|
||||
..
|
||||
.de MODULEX
|
||||
.MODULE \\$1 ,
|
||||
..
|
||||
.de TBD
|
||||
.ft B
|
||||
To be defined or to finish.
|
||||
.ft R
|
||||
..
|
||||
.de ARROW
|
||||
.br
|
||||
\(->\h'5p' \\$*
|
||||
..
|
||||
.af dy 00
|
||||
.af mo 00
|
||||
.ds CURRENT_DATE \\n(dy/\\n(mo/\\n[year]
|
||||
.ds WEBSITE https://t.karchnu.fr/doc
|
||||
.ds EMAIL karchnu@karchnu.fr
|
||||
.de INFORMATIONS
|
||||
Check out for newer versions:
|
||||
.ft CW
|
||||
.ps 8
|
||||
\h'2p' \\$1
|
||||
.ps
|
||||
.ft
|
||||
.br
|
||||
And if you have questions:
|
||||
.ft CW
|
||||
\h'13p' \\$2
|
||||
.ft
|
||||
.\" .DE
|
||||
|
||||
.LP
|
||||
Lastly compiled the
|
||||
.SHINE \*[CURRENT_DATE]
|
||||
(day/month/year, you know, like in any sane civilization).
|
||||
..
|
||||
.de INFORMATIONS_FR
|
||||
.LP
|
||||
Nouvelles versions :
|
||||
.ft CW
|
||||
.ps 8
|
||||
\h'2p' \\$1
|
||||
.ps
|
||||
.ft
|
||||
.br
|
||||
Questions :
|
||||
.ft CW
|
||||
\h'36p' \\$2
|
||||
.ft
|
||||
.\" .DE
|
||||
|
||||
.LP
|
||||
Compilé pour la dernière fois le
|
||||
.SHINE \*[CURRENT_DATE]
|
||||
..
|
||||
.
|
||||
.\" RENAMING REQUESTS
|
||||
.
|
||||
.de SECTION
|
||||
.NH
|
||||
.ps +3
|
||||
.fam H \" helvetica family
|
||||
\\$*
|
||||
.fam \" back to previous font family
|
||||
.ps
|
||||
.PARAGRAPH_INDENTED
|
||||
..
|
||||
.de SUBSECTION
|
||||
.NH 2
|
||||
.ps +1
|
||||
.fam H \" helvetica family
|
||||
\\$*
|
||||
.fam \" back to previous font family
|
||||
.ps
|
||||
.PARAGRAPH_INDENTED
|
||||
..
|
||||
.de SUBSUBSECTION
|
||||
.NH 3
|
||||
.fam H \" helvetica family
|
||||
\\$*
|
||||
.fam \" back to previous font family
|
||||
.ps
|
||||
.PARAGRAPH_INDENTED
|
||||
..
|
||||
.de SUBSUBSUBSECTION
|
||||
.NH 4
|
||||
.fam H \" helvetica family
|
||||
\\$*
|
||||
.fam \" back to previous font family
|
||||
.PARAGRAPH_INDENTED
|
||||
..
|
||||
.de SECTION_NO_NUMBER
|
||||
.SH
|
||||
.fam H \" helvetica family
|
||||
\\$*
|
||||
.fam \" back to previous font family
|
||||
.PARAGRAPH_INDENTED
|
||||
..
|
||||
.de SUBSECTION_NO_NUMBER
|
||||
.SH 2
|
||||
.fam H \" helvetica family
|
||||
\\$*
|
||||
.fam \" back to previous font family
|
||||
.PARAGRAPH_INDENTED
|
||||
..
|
||||
.de PARAGRAPH_INDENTED
|
||||
.PP
|
||||
..
|
||||
.de PARAGRAPH_UNINDENTED
|
||||
.LP
|
||||
..
|
||||
.de NO_ABSTRACT
|
||||
.AB no
|
||||
..
|
||||
.de ABSTRACT1
|
||||
.AB
|
||||
..
|
||||
.de ABSTRACT2
|
||||
.AE
|
||||
..
|
||||
.ds CH Page %
|
||||
.de TITLE
|
||||
.TL
|
||||
\\$*
|
||||
.ds LH \\$*
|
||||
.de HD .XX
|
||||
.sp -2.3
|
||||
.nr LINEWIDTH (\n[LL]/1.0i)
|
||||
\l'\\\\n[LINEWIDTH]i'
|
||||
.sp +1.5
|
||||
.br
|
||||
..XX
|
||||
..
|
||||
.de AUTHOR
|
||||
. AU
|
||||
. ie !'\\$1'' \\$*
|
||||
..
|
||||
.de FOOTNOTE1
|
||||
. FS
|
||||
..
|
||||
.de FOOTNOTE2
|
||||
. FE
|
||||
..
|
||||
.de VOCABULARY1
|
||||
. KS
|
||||
. BULLET
|
||||
. UL "\\$*" :
|
||||
..
|
||||
.de VOCABULARY2
|
||||
. KE
|
||||
..
|
||||
.
|
||||
.
|
||||
.de HIGHLIGHT
|
||||
.
|
||||
. nr @wd \w'\\$1'
|
||||
. nr x1 0
|
||||
. nr y1 (\\n[rst]u - \\n[rsb]u + .4m)
|
||||
. nr x2 (\\n[@wd]u + .4m)
|
||||
. nr y2 0
|
||||
. nr x3 0
|
||||
. nr y3 (\\n[rst]u - \\n[rsb]u + .4m)
|
||||
. nr x4 (\\n[@wd]u + .4m)
|
||||
. nr y4 0
|
||||
.
|
||||
\h'.2m'\
|
||||
\h'-.2m'\v'(.2m - \\n[rsb]u)'\
|
||||
\M[color_box]\
|
||||
\D'P \\n[x1] -\\n[y1]u \\n[x2]u \\n[y2]u \\n[x3]u \\n[y3]u -\\n[x4]u \\n[y4]u '\
|
||||
\h'.2m'\v'-(.2m - \\n[rsb]u)'\
|
||||
\M[]\
|
||||
\\$1\
|
||||
\h'.2m'
|
||||
..
|
||||
.
|
||||
.
|
||||
.
|
||||
.ds SPACE_SS_NUMBER_TITLE 0.5\" not a number register because of leading 0
|
||||
.nr CURRENT_SECTION 0 +1
|
||||
.nr CURRENT_APPENDIX 0
|
||||
.af CURRENT_APPENDIX I
|
||||
.nr CURRENT_SUBSECTION 0 +1
|
||||
.nr CURRENT_SSSECTION 0 +1
|
||||
.rm SECTION
|
||||
.de SECTION
|
||||
. nr CURRENT_SUBSECTION 0 \" reset current subsection numbering
|
||||
. nr CURRENT_SSSECTION 0 \" reset current subsubsection numbering
|
||||
. ie !(\\n[CURRENT_SECTION]=0) .sp +1
|
||||
. br
|
||||
. ie (\\n[APPENDIX_TIME]=0) \
|
||||
. ds RH \\n+[CURRENT_SECTION].\h'\\*[SPACE_SS_NUMBER_TITLE]' \\$*
|
||||
. el \{
|
||||
. ds RH \\n[CURRENT_APPENDIX].\h'\\*[SPACE_SS_NUMBER_TITLE]' \\$*
|
||||
. bp \}
|
||||
. ps +2
|
||||
. fam H \" helvetica family
|
||||
. ft B
|
||||
. ne 4 \" should be at least a few lines left at the bottom of the page
|
||||
\\*[RH]
|
||||
. ft
|
||||
. fam \" back to previous font family
|
||||
. ps -2
|
||||
. PARAGRAPH_INDENTED
|
||||
..
|
||||
.nr APPENDIX_TIME 0
|
||||
.de APPENDIX
|
||||
. nr CURRENT_APPENDIX +1
|
||||
. nr APPENDIX_TIME 1
|
||||
. SECTION \\$*
|
||||
..
|
||||
.de SS
|
||||
. nr CURRENT_SSSECTION 0
|
||||
. ie (\\n[APPENDIX_TIME]=0) \
|
||||
. SUBSECTION_NO_NUMBER \\n[CURRENT_SECTION].\
|
||||
\\n+[CURRENT_SUBSECTION]\h'\\*[SPACE_SS_NUMBER_TITLE]' \\$*
|
||||
.el \
|
||||
. SUBSECTION_NO_NUMBER \\n[CURRENT_APPENDIX].\
|
||||
\\n+[CURRENT_SUBSECTION]\h'\\*[SPACE_SS_NUMBER_TITLE]' \\$*
|
||||
..
|
||||
.de SSS
|
||||
. br
|
||||
. ps -2
|
||||
. fam H \" helvetica family
|
||||
. ft B
|
||||
. ie (\\n[APPENDIX_TIME]=0) \
|
||||
. SUBSECTION_NO_NUMBER \\n[CURRENT_SECTION].\
|
||||
\\n[CURRENT_SUBSECTION].\\n+[CURRENT_SSSECTION]\h'\
|
||||
\\*[SPACE_SS_NUMBER_TITLE]' \\$*
|
||||
. el \
|
||||
\\n[CURRENT_APPENDIX].\
|
||||
\\n[CURRENT_SUBSECTION].\\n+[CURRENT_SSSECTION]\h'\
|
||||
\\*[SPACE_SS_NUMBER_TITLE]' \\$*
|
||||
. ft
|
||||
. fam \" back to previous font family
|
||||
. ps +2
|
||||
. PARAGRAPH_INDENTED
|
||||
..
|
||||
.de INNERBULLET
|
||||
. in +1
|
||||
. br
|
||||
\(bu
|
||||
. in +1
|
||||
. sp -1
|
||||
\\$*
|
||||
. in -2
|
||||
..
|
||||
.de EENUM \" Numbered list
|
||||
. nr ENUM_INDENTATION 2
|
||||
. ie !(\\n[LIST_NUMBER]=0) .in -\\n[ENUM_INDENTATION]
|
||||
. br
|
||||
\\n+[LIST_NUMBER].
|
||||
. in +\\n[ENUM_INDENTATION]
|
||||
. sp -1
|
||||
\\$*
|
||||
..
|
||||
.de EENDENUM
|
||||
. nr LIST_NUMBER 0
|
||||
. in -\\n[ENUM_INDENTATION]
|
||||
..
|
||||
.nr legendps 2
|
||||
.de LEGEND1
|
||||
. QP
|
||||
. vs -\\n[legendps]p
|
||||
. ps -\\n[legendps]
|
||||
. in -1.2
|
||||
. ll +1.2
|
||||
. br
|
||||
..
|
||||
.de LEGEND2
|
||||
. br
|
||||
. vs +\\n[legendps]p
|
||||
. ps +\\n[legendps]
|
||||
. br
|
||||
. LP
|
||||
..
|
||||
.de IEME
|
||||
\\$1\u\s-4\\$2\s+4\d
|
||||
..
|
||||
.de CENTERED
|
||||
. ce
|
||||
\\$*
|
||||
. br
|
||||
..
|
||||
.de GIVEEXAMPLE1
|
||||
. in +1
|
||||
. ll -1
|
||||
. KS \" start a keep
|
||||
. \" .ft I \" citation in italics
|
||||
. mk C \" set a marker for line drawing
|
||||
. in +1 \" indent a bit
|
||||
. gcolor citation
|
||||
..
|
||||
.de GIVEEXAMPLE2
|
||||
. mk D \" set second marker to come back here
|
||||
. \" .ft \" back to previous font
|
||||
. in -1 \" remove indent
|
||||
. gcolor black\" remove previous color
|
||||
. gcolor citationbar
|
||||
. \" r = move upward
|
||||
. \" Z D t = drawing thickness
|
||||
. \" L = draw the line
|
||||
\r\
|
||||
\Z'\D't 1p''\
|
||||
\L'|\\nCu' \" draw line
|
||||
. gcolor black \" remove previous color
|
||||
. sp -2 \" get two lines back
|
||||
\Z'\D't 0.5p'' \" get the previous drawing thickness back
|
||||
. KE \" end of the keep
|
||||
. ll +1
|
||||
. in -1
|
||||
..
|
||||
.de ST
|
||||
.nr ww \w'\\$1'
|
||||
\Z@\v'-.25m'\l'\\n[ww]u'@\\$1
|
||||
..
|
||||
.de INCREMENT
|
||||
.br
|
||||
.in \\*[PINCREMENT]
|
||||
.br
|
||||
\h'-\\*[DECALAGE]'\\*[CHARACTER]\h'|0'\\$*
|
||||
..
|
||||
.de D
|
||||
.ds DECALAGE 1.0
|
||||
.ds PINCREMENT 2
|
||||
.ds CHARACTER \(bu
|
||||
.INCREMENT \\$*
|
||||
..
|
||||
.de DD
|
||||
.ds DECALAGE 1.0
|
||||
.ds PINCREMENT 3
|
||||
.ds CHARACTER \(bu
|
||||
.INCREMENT \\$*
|
||||
..
|
||||
.de AA
|
||||
.ds DECALAGE 1.5
|
||||
.ds PINCREMENT 3
|
||||
.ds CHARACTER \(->
|
||||
.INCREMENT \\$*
|
||||
..
|
||||
.de AAA
|
||||
.ds DECALAGE 1.5
|
||||
.ds PINCREMENT 4
|
||||
.ds CHARACTER \(->
|
||||
.INCREMENT \\$*
|
||||
..
|
||||
.de ED
|
||||
.br
|
||||
.in 0
|
||||
..
|
1382
paper/paper.ms
Normal file
1382
paper/paper.ms
Normal file
File diff suppressed because it is too large
Load Diff
69
paper/troffrc
Normal file
69
paper/troffrc
Normal file
@ -0,0 +1,69 @@
|
||||
.\" Startup file for troff.
|
||||
.
|
||||
.\" This is tested by pic.
|
||||
.nr 0p 0
|
||||
.
|
||||
.\" Load composite mappings.
|
||||
.do mso composite.tmac
|
||||
.
|
||||
.\" Load generic fallback mappings.
|
||||
.do mso fallbacks.tmac
|
||||
.
|
||||
.\" Use .do here, so that it works with -C.
|
||||
.\" The groff command defines the .X string if the -X option was given.
|
||||
.ie r.X .do ds troffrc!ps Xps.tmac
|
||||
.el .do ds troffrc!ps ps.tmac
|
||||
.do ds troffrc!pdf pdf.tmac
|
||||
.do ds troffrc!dvi dvi.tmac
|
||||
.do ds troffrc!X75 X.tmac
|
||||
.do ds troffrc!X75-12 X.tmac
|
||||
.do ds troffrc!X100 X.tmac
|
||||
.do ds troffrc!X100-12 X.tmac
|
||||
.do ds troffrc!ascii tty.tmac
|
||||
.do ds troffrc!latin1 tty.tmac
|
||||
.do ds troffrc!utf8 tty.tmac
|
||||
.do ds troffrc!cp1047 tty.tmac
|
||||
.do ds troffrc!lj4 lj4.tmac
|
||||
.do ds troffrc!lbp lbp.tmac
|
||||
.do ds troffrc!html html.tmac
|
||||
.do if d troffrc!\*[.T] \
|
||||
. do mso \*[troffrc!\*[.T]]
|
||||
.do rm troffrc!ps troffrc!Xps troffrc!dvi troffrc!X75 troffrc!X75-12 \
|
||||
troffrc!X100 troffrc!X100-12 troffrc!lj4 troff!lbp troffrc!html troffrc!pdf
|
||||
.
|
||||
.\" Test whether we work under EBCDIC and map the no-breakable space
|
||||
.\" character accordingly.
|
||||
.do ie '\[char97]'a' \
|
||||
. do tr \[char160]\~
|
||||
.el \
|
||||
. do tr \[char65]\~
|
||||
.
|
||||
.\" Set the hyphenation language to 'us'.
|
||||
.do hla us
|
||||
.
|
||||
.\" Disable hyphenation:
|
||||
.\" Do not load hyphenation patterns and exceptions.
|
||||
.\"do hpf hyphen.us
|
||||
.\"do hpfa hyphenex.us
|
||||
.
|
||||
.\" Disable adjustment by default,
|
||||
.\" such that manuals look similar with groff and mandoc(1).
|
||||
.\".ad l
|
||||
.\".de ad
|
||||
.\"..
|
||||
.\" Handle paper formats.
|
||||
.do mso papersize.tmac
|
||||
.
|
||||
.\" Handle PS images.
|
||||
.do mso pspic.tmac
|
||||
.do mso pdfpic.tmac
|
||||
.
|
||||
.\" ====================================================================
|
||||
.\" Editor settings
|
||||
.\" ====================================================================
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" fill-column: 72
|
||||
.\" End:
|
||||
.\" vim: set filetype=groff textwidth=72:
|
@ -1,5 +1,5 @@
|
||||
name: dodb
|
||||
version: 0.5.1
|
||||
version: 0.5.0
|
||||
|
||||
authors:
|
||||
- Luka Vandervelden <lukc@upyum.com>
|
||||
|
@ -12,20 +12,104 @@ require "./db-cars.cr"
|
||||
# ENV["REPORT_DIR"] rescue "results"
|
||||
# ENV["NBRUN"] rescue 100
|
||||
# ENV["MAXINDEXES"] rescue 5_000
|
||||
# ENV["LRU_SIZE"] rescue 10_000
|
||||
# ENV["FIFO_SIZE"] rescue 10_000
|
||||
|
||||
require "./utilities-cars.cr"
|
||||
class Context
|
||||
class_property report_dir = "results"
|
||||
class_property max_indexes = 5_000
|
||||
class_property nb_run = 100
|
||||
class_property from = 1_000
|
||||
class_property to = 50_000
|
||||
class_property incr = 1_000
|
||||
class_property fifo_size : UInt32 = 10_000
|
||||
end
|
||||
|
||||
# To simplify the creation of graphs, it's better to have fake data for
|
||||
# partitions and tags that won't be actually covered.
|
||||
# 0 means the absence of data.
|
||||
def fake_report(name)
|
||||
durations = Array(Int32).new Context.nb_run, 0
|
||||
File.open("#{Context.report_dir}/#{name}.raw", "w") do |file|
|
||||
durations.each do |d|
|
||||
file.puts d
|
||||
end
|
||||
end
|
||||
puts "#{name}: no report"
|
||||
end
|
||||
def report(storage, name, &block)
|
||||
durations = run_n_times Context.nb_run, &block
|
||||
File.open("#{Context.report_dir}/#{name}.raw", "w") do |file|
|
||||
durations.each do |d|
|
||||
file.puts d
|
||||
end
|
||||
end
|
||||
avr = durations.reduce { |a, b| a + b } / Context.nb_run
|
||||
puts "#{name}: #{avr}"
|
||||
avr
|
||||
end
|
||||
|
||||
def verbose_add_cars(storage, nbcars, name, max_indexes)
|
||||
long_operation "add #{nbcars} values to #{name}" do
|
||||
add_cars storage, nbcars, max_indexes: max_indexes
|
||||
end
|
||||
end
|
||||
|
||||
# Add first entries, then loop: speed tests, add entries.
|
||||
def prepare_env(storage, name, s_index, s_partition, s_tags, &)
|
||||
verbose_add_cars storage, Context.from, name, max_indexes: Context.max_indexes
|
||||
|
||||
current = Context.from
|
||||
to = Context.to
|
||||
incr = Context.incr
|
||||
|
||||
while current < to
|
||||
yield storage, current, name, s_index, s_partition, s_tags
|
||||
|
||||
break if current + incr >= to
|
||||
|
||||
verbose_add_cars storage, incr, name, max_indexes: Context.max_indexes
|
||||
current += incr
|
||||
end
|
||||
|
||||
long_operation "removing #{name} data" { storage.rm_storage_dir }
|
||||
end
|
||||
|
||||
def search_benchmark(storage : DODB::Storage(Car),
|
||||
current_db_size : Int32,
|
||||
name : String,
|
||||
search_name : DODB::Trigger::Index(Car),
|
||||
search_color : DODB::Trigger::Partition(Car),
|
||||
search_keywords : DODB::Trigger::Tags(Car))
|
||||
name_to_search = ENV["CARNAME"] rescue "Corvet-#{(current_db_size/2).to_i}"
|
||||
color_to_search = ENV["CARCOLOR"] rescue "red"
|
||||
keyword_to_search = ENV["CARKEYWORD"] rescue "spacious"
|
||||
puts "NEW BATCH: db-size #{current_db_size}, name: '#{name_to_search}', color: '#{color_to_search}', tag: '#{keyword_to_search}'"
|
||||
report(storage, "#{name}_#{current_db_size}_index") do
|
||||
corvet = search_name.get name_to_search
|
||||
end
|
||||
if current_db_size <= Context.max_indexes
|
||||
report(storage, "#{name}_#{current_db_size}_partitions") do
|
||||
corvet = search_color.get? color_to_search
|
||||
end
|
||||
report(storage, "#{name}_#{current_db_size}_tags") do
|
||||
corvet = search_keywords.get? keyword_to_search
|
||||
end
|
||||
else
|
||||
fake_report("#{name}_#{current_db_size}_partitions")
|
||||
fake_report("#{name}_#{current_db_size}_tags")
|
||||
end
|
||||
end
|
||||
|
||||
def bench_searches()
|
||||
cars_ram = SPECDB::RAMOnly(Car).new
|
||||
cars_cached = SPECDB::Cached(Car).new
|
||||
cars_lru = SPECDB::Common(Car).new "-#{Context.lru_size}", Context.lru_size
|
||||
cars_fifo = SPECDB::Common(Car).new "-#{Context.fifo_size}", Context.fifo_size
|
||||
cars_semi = SPECDB::Uncached(Car).new "-semi"
|
||||
cars_uncached = SPECDB::Uncached(Car).new
|
||||
|
||||
ram_Sby_name, ram_Sby_color, ram_Sby_keywords = ram_indexes cars_ram
|
||||
cached_Sby_name, cached_Sby_color, cached_Sby_keywords = cached_indexes cars_cached
|
||||
lru_Sby_name, lru_Sby_color, lru_Sby_keywords = cached_indexes cars_lru
|
||||
fifo_Sby_name, fifo_Sby_color, fifo_Sby_keywords = cached_indexes cars_fifo
|
||||
semi_Sby_name, semi_Sby_color, semi_Sby_keywords = cached_indexes cars_semi
|
||||
uncached_Sby_name, uncached_Sby_color, uncached_Sby_keywords = uncached_indexes cars_uncached
|
||||
|
||||
@ -33,21 +117,32 @@ def bench_searches()
|
||||
|
||||
prepare_env cars_ram, "ram", ram_Sby_name, ram_Sby_color, ram_Sby_keywords, &fn
|
||||
prepare_env cars_cached, "cached", cached_Sby_name, cached_Sby_color, cached_Sby_keywords, &fn
|
||||
prepare_env cars_lru, "lru", lru_Sby_name, lru_Sby_color, lru_Sby_keywords, &fn
|
||||
prepare_env cars_fifo, "fifo", fifo_Sby_name, fifo_Sby_color, fifo_Sby_keywords, &fn
|
||||
prepare_env cars_semi, "semi", semi_Sby_name, semi_Sby_color, semi_Sby_keywords, &fn
|
||||
prepare_env cars_uncached, "uncached", uncached_Sby_name, uncached_Sby_color, uncached_Sby_keywords, &fn
|
||||
end
|
||||
|
||||
def perform_add(storage : DODB::Storage(Car))
|
||||
corvet0 = Car.new "Corvet", "red", [ "shiny", "impressive", "fast", "elegant" ]
|
||||
i = 0
|
||||
perform_benchmark_average Context.nb_run, do
|
||||
corvet = corvet0.clone
|
||||
corvet.name = "Corvet-#{i}"
|
||||
storage.unsafe_add corvet
|
||||
i += 1
|
||||
end
|
||||
end
|
||||
|
||||
def bench_add()
|
||||
cars_ram = SPECDB::RAMOnly(Car).new
|
||||
cars_cached = SPECDB::Cached(Car).new
|
||||
cars_lru = SPECDB::Common(Car).new "-#{Context.lru_size}", Context.lru_size
|
||||
cars_fifo = SPECDB::Common(Car).new "-#{Context.fifo_size}", Context.fifo_size
|
||||
cars_semi = SPECDB::Uncached(Car).new "-semi"
|
||||
cars_uncached = SPECDB::Uncached(Car).new
|
||||
|
||||
ram_indexes cars_ram
|
||||
cached_indexes cars_cached
|
||||
cached_indexes cars_lru
|
||||
cached_indexes cars_fifo
|
||||
cached_indexes cars_semi
|
||||
uncached_indexes cars_uncached
|
||||
|
||||
@ -57,8 +152,8 @@ def bench_add()
|
||||
avr = perform_add(cars_cached)
|
||||
puts "(cached db and indexes) add a value (average on #{Context.nb_run} tries): #{avr}"
|
||||
|
||||
avr = perform_add(cars_lru)
|
||||
puts "(lru db and cached indexes) add a value (average on #{Context.nb_run} tries): #{avr}"
|
||||
avr = perform_add(cars_fifo)
|
||||
puts "(fifo db and cached indexes) add a value (average on #{Context.nb_run} tries): #{avr}"
|
||||
|
||||
avr = perform_add(cars_semi)
|
||||
puts "(uncached db but cached indexes) add a value (average on #{Context.nb_run} tries): #{avr}"
|
||||
@ -72,23 +167,23 @@ def bench_add()
|
||||
cars_uncached.rm_storage_dir
|
||||
end
|
||||
|
||||
def bench_50_shades_of_lru()
|
||||
cars_lru1 = SPECDB::Common(Car).new "-1k", 1_000
|
||||
cars_lru5 = SPECDB::Common(Car).new "-5k", 5_000
|
||||
cars_lru10 = SPECDB::Common(Car).new "-10k", 10_000
|
||||
cars_lru20 = SPECDB::Common(Car).new "-20k", 20_000
|
||||
def bench_50_shades_of_fifo()
|
||||
cars_fifo1 = SPECDB::Common(Car).new "-1k", 1_000
|
||||
cars_fifo5 = SPECDB::Common(Car).new "-5k", 5_000
|
||||
cars_fifo10 = SPECDB::Common(Car).new "-10k", 10_000
|
||||
cars_fifo20 = SPECDB::Common(Car).new "-20k", 20_000
|
||||
|
||||
lru_Sby_name1, lru_Sby_color1, lru_Sby_keywords1 = cached_indexes cars_lru1
|
||||
lru_Sby_name5, lru_Sby_color5, lru_Sby_keywords5 = cached_indexes cars_lru5
|
||||
lru_Sby_name10, lru_Sby_color10, lru_Sby_keywords10 = cached_indexes cars_lru10
|
||||
lru_Sby_name20, lru_Sby_color20, lru_Sby_keywords20 = cached_indexes cars_lru20
|
||||
fifo_Sby_name1, fifo_Sby_color1, fifo_Sby_keywords1 = cached_indexes cars_fifo1
|
||||
fifo_Sby_name5, fifo_Sby_color5, fifo_Sby_keywords5 = cached_indexes cars_fifo5
|
||||
fifo_Sby_name10, fifo_Sby_color10, fifo_Sby_keywords10 = cached_indexes cars_fifo10
|
||||
fifo_Sby_name20, fifo_Sby_color20, fifo_Sby_keywords20 = cached_indexes cars_fifo20
|
||||
|
||||
fn = ->search_benchmark(DODB::Storage(Car), Int32, String, DODB::Trigger::Index(Car), DODB::Trigger::Partition(Car), DODB::Trigger::Tags(Car))
|
||||
|
||||
prepare_env cars_lru1, "lru1", lru_Sby_name1, lru_Sby_color1, lru_Sby_keywords1, &fn
|
||||
prepare_env cars_lru5, "lru5", lru_Sby_name5, lru_Sby_color5, lru_Sby_keywords5, &fn
|
||||
prepare_env cars_lru10, "lru10", lru_Sby_name10, lru_Sby_color10, lru_Sby_keywords10, &fn
|
||||
prepare_env cars_lru20, "lru20", lru_Sby_name20, lru_Sby_color20, lru_Sby_keywords20, &fn
|
||||
prepare_env cars_fifo1, "fifo1", fifo_Sby_name1, fifo_Sby_color1, fifo_Sby_keywords1, &fn
|
||||
prepare_env cars_fifo5, "fifo5", fifo_Sby_name5, fifo_Sby_color5, fifo_Sby_keywords5, &fn
|
||||
prepare_env cars_fifo10, "fifo10", fifo_Sby_name10, fifo_Sby_color10, fifo_Sby_keywords10, &fn
|
||||
prepare_env cars_fifo20, "fifo20", fifo_Sby_name20, fifo_Sby_color20, fifo_Sby_keywords20, &fn
|
||||
end
|
||||
|
||||
ENV["REPORT_DIR"]?.try { |report_dir| Context.report_dir = report_dir }
|
||||
@ -99,7 +194,7 @@ ENV["NBRUN"]?.try { |it| Context.nb_run = it.to_i }
|
||||
ENV["DBSIZE"]?.try { |it| Context.to = it.to_i }
|
||||
ENV["DBSIZE_START"]?.try { |it| Context.from = it.to_i }
|
||||
ENV["DBSIZE_INCREMENT"]?.try { |it| Context.incr = it.to_i }
|
||||
ENV["LRU_SIZE"]?.try { |it| Context.lru_size = it.to_u32 }
|
||||
ENV["FIFO_SIZE"]?.try { |it| Context.fifo_size = it.to_u32 }
|
||||
|
||||
puts "REPORT_DIR: #{Context.report_dir}"
|
||||
puts "MAXINDEXES: #{Context.max_indexes}"
|
||||
@ -107,20 +202,20 @@ puts "NBRUN: #{Context.nb_run}"
|
||||
puts "DBSIZE: #{Context.to}"
|
||||
puts "DBSIZE_START: #{Context.from}"
|
||||
puts "DBSIZE_INCREMENT: #{Context.incr}"
|
||||
puts "LRU_SIZE: #{Context.lru_size}"
|
||||
puts "FIFO_SIZE: #{Context.fifo_size}"
|
||||
|
||||
if ARGV.size == 0
|
||||
puts "Usage: benchmark-cars (lru|search|add)"
|
||||
puts "Usage: benchmark-cars (fifo|search|add)"
|
||||
exit 0
|
||||
end
|
||||
|
||||
case ARGV[0]
|
||||
when /lru/
|
||||
bench_50_shades_of_lru
|
||||
when /fifo/
|
||||
bench_50_shades_of_fifo
|
||||
when /search/
|
||||
bench_searches
|
||||
when /add/
|
||||
bench_add
|
||||
else
|
||||
puts "Usage: benchmark-cars (lru|search|add)"
|
||||
puts "Usage: benchmark-cars (fifo|search|add)"
|
||||
end
|
||||
|
70
spec/benchmark-fifo.cr
Normal file
70
spec/benchmark-fifo.cr
Normal file
@ -0,0 +1,70 @@
|
||||
require "benchmark"
|
||||
require "./utilities.cr"
|
||||
require "../src/fifo.cr"
|
||||
|
||||
def add(fifo : FIFO(Int32) | EfficientFIFO(Int32), nb : UInt32)
|
||||
i = 0
|
||||
while i < nb
|
||||
fifo << i
|
||||
i += 1
|
||||
end
|
||||
end
|
||||
|
||||
def report_add(fifo : FIFO(Int32) | EfficientFIFO(Int32), nb : UInt32, fname : String)
|
||||
File.open("#{Context.report_dir}/#{fname}.raw", "w") do |file|
|
||||
i = 0
|
||||
while i < nb
|
||||
elapsed_time = perform_something { fifo << i }
|
||||
i += 1
|
||||
file.puts "#{i} #{elapsed_time.total_nanoseconds}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class Context
|
||||
class_property nb_values : UInt32 = 100_000
|
||||
class_property fifo_size : UInt32 = 10_000
|
||||
class_property report_dir = "results"
|
||||
end
|
||||
|
||||
if nb_values = ENV["NBVAL"]?
|
||||
Context.nb_values = nb_values.to_u32
|
||||
end
|
||||
|
||||
if fifo_size = ENV["FIFOSIZE"]?
|
||||
Context.fifo_size = fifo_size.to_u32
|
||||
end
|
||||
|
||||
if ARGV.size > 0
|
||||
puts "Usage: benchmark-fifo"
|
||||
puts ""
|
||||
puts "envvar: REPORT_DIR=<directory> where to put the results"
|
||||
puts "envvar: REPORT_EACH_ADD=<any> to report the duration of each addition of a value in the structure"
|
||||
puts "envvar: NBVAL=<nb> (default: 100_000) nb of values to add to the structure"
|
||||
puts "envvar: FIFOSIZE=<nb> (default: 10_000) max number of values in the structure"
|
||||
exit 0
|
||||
end
|
||||
|
||||
ENV["REPORT_DIR"]?.try { |report_dir| Context.report_dir = report_dir }
|
||||
Dir.mkdir_p Context.report_dir
|
||||
|
||||
if ENV["REPORT_EACH_ADD"]?
|
||||
FIFO(Int32).new(Context.fifo_size).tap do |fifo|
|
||||
report_add fifo, Context.nb_values, "fifo_#{Context.fifo_size}_#{Context.nb_values}"
|
||||
end
|
||||
EfficientFIFO(Int32).new(Context.fifo_size).tap do |fifo|
|
||||
report_add fifo, Context.nb_values, "efficientfifo_#{Context.fifo_size}_#{Context.nb_values}"
|
||||
end
|
||||
else
|
||||
Benchmark.ips do |x|
|
||||
x.report("adding #{Context.nb_values} values, FIFO limited to #{Context.fifo_size}") do
|
||||
fifo = FIFO(Int32).new Context.fifo_size
|
||||
add fifo, Context.nb_values
|
||||
end
|
||||
|
||||
x.report("adding #{Context.nb_values} values, EfficientFIFO limited to #{Context.fifo_size}") do
|
||||
fifo = EfficientFIFO(Int32).new Context.fifo_size
|
||||
add fifo, Context.nb_values
|
||||
end
|
||||
end
|
||||
end
|
@ -1,70 +0,0 @@
|
||||
require "benchmark"
|
||||
require "./utilities.cr"
|
||||
require "../src/lru.cr"
|
||||
|
||||
def add(lru : LRU(Int32) | EfficientLRU(Int32), nb : UInt32)
|
||||
i = 0
|
||||
while i < nb
|
||||
lru << i
|
||||
i += 1
|
||||
end
|
||||
end
|
||||
|
||||
def report_add(lru : LRU(Int32) | EfficientLRU(Int32), nb : UInt32, fname : String)
|
||||
File.open("#{Context.report_dir}/#{fname}.raw", "w") do |file|
|
||||
i = 0
|
||||
while i < nb
|
||||
elapsed_time = perform_something { lru << i }
|
||||
i += 1
|
||||
file.puts "#{i} #{elapsed_time.total_nanoseconds}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class Context
|
||||
class_property nb_values : UInt32 = 100_000
|
||||
class_property lru_size : UInt32 = 10_000
|
||||
class_property report_dir = "results"
|
||||
end
|
||||
|
||||
if nb_values = ENV["NBVAL"]?
|
||||
Context.nb_values = nb_values.to_u32
|
||||
end
|
||||
|
||||
if lru_size = ENV["LRUSIZE"]?
|
||||
Context.lru_size = lru_size.to_u32
|
||||
end
|
||||
|
||||
if ARGV.size > 0
|
||||
puts "Usage: benchmark-lru"
|
||||
puts ""
|
||||
puts "envvar: REPORT_DIR=<directory> where to put the results"
|
||||
puts "envvar: REPORT_EACH_ADD=<any> to report the duration of each addition of a value in the structure"
|
||||
puts "envvar: NBVAL=<nb> (default: 100_000) nb of values to add to the structure"
|
||||
puts "envvar: LRUSIZE=<nb> (default: 10_000) max number of values in the structure"
|
||||
exit 0
|
||||
end
|
||||
|
||||
ENV["REPORT_DIR"]?.try { |report_dir| Context.report_dir = report_dir }
|
||||
Dir.mkdir_p Context.report_dir
|
||||
|
||||
if ENV["REPORT_EACH_ADD"]?
|
||||
LRU(Int32).new(Context.lru_size).tap do |lru|
|
||||
report_add lru, Context.nb_values, "lru_#{Context.lru_size}_#{Context.nb_values}"
|
||||
end
|
||||
EfficientLRU(Int32).new(Context.lru_size).tap do |lru|
|
||||
report_add lru, Context.nb_values, "efficientlru_#{Context.lru_size}_#{Context.nb_values}"
|
||||
end
|
||||
else
|
||||
Benchmark.ips do |x|
|
||||
x.report("adding #{Context.nb_values} values, LRU limited to #{Context.lru_size}") do
|
||||
lru = LRU(Int32).new Context.lru_size
|
||||
add lru, Context.nb_values
|
||||
end
|
||||
|
||||
x.report("adding #{Context.nb_values} values, EfficientLRU limited to #{Context.lru_size}") do
|
||||
lru = EfficientLRU(Int32).new Context.lru_size
|
||||
add lru, Context.nb_values
|
||||
end
|
||||
end
|
||||
end
|
@ -1,45 +0,0 @@
|
||||
require "./db-cars.cr"
|
||||
require "./utilities.cr"
|
||||
|
||||
class Context
|
||||
class_property dbsize = 1_000_000
|
||||
class_property nb_run = 100
|
||||
end
|
||||
|
||||
ENV["DBSIZE"]?.try { |it| Context.dbsize = it.to_i }
|
||||
ENV["NBRUN"]?.try { |it| Context.nb_run = it.to_i }
|
||||
|
||||
if ARGV.size == 0
|
||||
puts "Usage: high-volume-db (add|get)"
|
||||
exit 0
|
||||
end
|
||||
|
||||
db = DODB::Storage::Common(Car).new "TESTDB", 5000
|
||||
by_name = db.new_index "name", &.name
|
||||
|
||||
something = Hash(String,Bool).new
|
||||
|
||||
case ARGV[0]
|
||||
when /get/
|
||||
counter = 0
|
||||
car_number_to_get = (Context.dbsize/2).to_i
|
||||
puts "let's get the car #{car_number_to_get}"
|
||||
avr = perform_benchmark_average Context.nb_run, do
|
||||
car = by_name.get "somecar-#{car_number_to_get}"
|
||||
something[car.name] = true
|
||||
#STDOUT.write "\rgot the car #{car.name}: #{counter}/#{Context.nb_run}".to_slice
|
||||
counter += 1
|
||||
end
|
||||
puts
|
||||
puts "average time was: #{avr}"
|
||||
puts "done!"
|
||||
when /add/
|
||||
counter = db.last_key
|
||||
while counter < Context.dbsize
|
||||
STDOUT.write "\radding car #{counter}/#{Context.dbsize}".to_slice
|
||||
db << Car.new "somecar-#{counter}", "red", [] of String
|
||||
counter += 1
|
||||
end
|
||||
puts
|
||||
puts "done!"
|
||||
end
|
@ -45,84 +45,59 @@ describe "tracking inconsistencies between implementations" do
|
||||
cars_ram0 = SPECDB::RAMOnly(Car).new "-0"
|
||||
cars_ram1 = SPECDB::RAMOnly(Car).new "-1"
|
||||
cars_ram2 = SPECDB::RAMOnly(Car).new "-2"
|
||||
cars_lru = SPECDB::Common(Car).new "-3", 5
|
||||
cars_fifo = SPECDB::Common(Car).new "-2", 5
|
||||
|
||||
uncached_searchby_name, uncached_searchby_color, uncached_searchby_keywords = uncached_indexes cars_ram0
|
||||
cached_searchby_name, cached_searchby_color, cached_searchby_keywords = cached_indexes cars_ram1
|
||||
ram_searchby_name, ram_searchby_color, ram_searchby_keywords = ram_indexes cars_ram2
|
||||
lru_cached_searchby_name, lru_cached_searchby_color, lru_cached_searchby_keywords = cached_indexes cars_lru
|
||||
uncached_searchby_name, uncached_searchby_color, uncached_searchby_keywords = uncached_indexes cars_ram0
|
||||
cached_searchby_name, cached_searchby_color, cached_searchby_keywords = cached_indexes cars_ram1
|
||||
ram_searchby_name, ram_searchby_color, ram_searchby_keywords = ram_indexes cars_ram2
|
||||
fifo_cached_searchby_name, fifo_cached_searchby_color, fifo_cached_searchby_keywords = cached_indexes cars_fifo
|
||||
|
||||
add_cars cars_ram0, 1
|
||||
add_cars cars_ram1, 1
|
||||
add_cars cars_ram2, 1
|
||||
add_cars cars_lru, 1
|
||||
add_cars cars_fifo, 1
|
||||
|
||||
# Searches should be consistent between all implementations of basic indexes, partitions and tags.
|
||||
|
||||
# Basic index.
|
||||
uncached_corvet_car = uncached_searchby_name.get? "Corvet-0"
|
||||
cached_corvet_car = cached_searchby_name.get? "Corvet-0"
|
||||
ram_corvet_car = ram_searchby_name.get? "Corvet-0"
|
||||
lru_cached_corvet_car = lru_cached_searchby_name.get? "Corvet-0"
|
||||
uncached_corvet_car = uncached_searchby_name.get? "Corvet-0"
|
||||
cached_corvet_car = cached_searchby_name.get? "Corvet-0"
|
||||
ram_corvet_car = ram_searchby_name.get? "Corvet-0"
|
||||
fifo_cached_corvet_car = fifo_cached_searchby_name.get? "Corvet-0"
|
||||
uncached_corvet_car.should eq cached_corvet_car
|
||||
uncached_corvet_car.should eq ram_corvet_car
|
||||
uncached_corvet_car.should eq lru_cached_corvet_car
|
||||
uncached_corvet_car.should eq fifo_cached_corvet_car
|
||||
uncached_corvet_car.should eq corvet0
|
||||
|
||||
# Partitions.
|
||||
red_cars = [ Car.new("Corvet-0", "red", [ "shiny", "impressive", "fast", "elegant" ]),
|
||||
Car.new("Ford-5-0", "red", [ "unknown" ])
|
||||
]
|
||||
uncached_red_cars = uncached_searchby_color.get? "red"
|
||||
cached_red_cars = cached_searchby_color.get? "red"
|
||||
ram_red_cars = ram_searchby_color.get? "red"
|
||||
lru_cached_red_cars = lru_cached_searchby_color.get? "red"
|
||||
uncached_red_cars = uncached_searchby_color.get? "red"
|
||||
cached_red_cars = cached_searchby_color.get? "red"
|
||||
ram_red_cars = ram_searchby_color.get? "red"
|
||||
fifo_cached_red_cars = fifo_cached_searchby_color.get? "red"
|
||||
uncached_red_cars.sort.should eq cached_red_cars.sort
|
||||
uncached_red_cars.sort.should eq ram_red_cars.sort
|
||||
uncached_red_cars.sort.should eq lru_cached_red_cars.sort
|
||||
uncached_red_cars.sort.should eq fifo_cached_red_cars.sort
|
||||
uncached_red_cars.sort.should eq red_cars.sort
|
||||
|
||||
# Tags.
|
||||
fast_cars = [ Car.new("Corvet-0", "red", [ "shiny", "impressive", "fast", "elegant" ]),
|
||||
Car.new("Bullet-GT-0", "blue", [ "shiny", "fast", "expensive" ])
|
||||
]
|
||||
uncached_fast_cars = uncached_searchby_keywords.get? "fast"
|
||||
cached_fast_cars = cached_searchby_keywords.get? "fast"
|
||||
ram_fast_cars = ram_searchby_keywords.get? "fast"
|
||||
lru_cached_fast_cars = lru_cached_searchby_keywords.get? "fast"
|
||||
uncached_fast_cars = uncached_searchby_keywords.get? "fast"
|
||||
cached_fast_cars = cached_searchby_keywords.get? "fast"
|
||||
ram_fast_cars = ram_searchby_keywords.get? "fast"
|
||||
fifo_cached_fast_cars = fifo_cached_searchby_keywords.get? "fast"
|
||||
uncached_fast_cars.sort.should eq cached_fast_cars.sort
|
||||
uncached_fast_cars.sort.should eq ram_fast_cars.sort
|
||||
uncached_fast_cars.sort.should eq lru_cached_fast_cars.sort
|
||||
uncached_fast_cars.sort.should eq fifo_cached_fast_cars.sort
|
||||
uncached_fast_cars.sort.should eq fast_cars.sort
|
||||
|
||||
cars_ram0.rm_storage_dir
|
||||
cars_ram1.rm_storage_dir
|
||||
cars_ram2.rm_storage_dir
|
||||
cars_lru.rm_storage_dir
|
||||
end
|
||||
end
|
||||
|
||||
describe "Errors" do
|
||||
it "Removing an entry which doesn't exist" do
|
||||
db = SPECDB::RAMOnly(Car).new
|
||||
searchby_name, searchby_color, searchby_keywords = uncached_indexes db
|
||||
|
||||
searchby_name.delete?( "doesn't exist").should be_nil # Should not throw an exception.
|
||||
searchby_color.delete?( "doesn't exist").should be_nil # Should not throw an exception.
|
||||
searchby_keywords.delete?("doesn't exist").should be_nil # Should not throw an exception.
|
||||
|
||||
expect_raises DODB::MissingEntry do
|
||||
searchby_name.delete "doesn't exist"
|
||||
end
|
||||
|
||||
expect_raises DODB::MissingEntry do
|
||||
searchby_color.delete "doesn't exist"
|
||||
end
|
||||
|
||||
expect_raises DODB::MissingEntry do
|
||||
searchby_keywords.delete "doesn't exist"
|
||||
end
|
||||
|
||||
db.rm_storage_dir
|
||||
cars_fifo.rm_storage_dir
|
||||
end
|
||||
end
|
||||
|
@ -1,10 +1,6 @@
|
||||
require "spec"
|
||||
require "./db-cars.cr"
|
||||
|
||||
# NOTE: the following tests access both database and triggers' caches directly.
|
||||
# It must not be done in real applications.
|
||||
# `data` and `lru` properties are implementation details.
|
||||
|
||||
describe "SPECDB::Common" do
|
||||
it "basics, 3 values" do
|
||||
car0 = Car.new "Corvet-0", "red", [] of String
|
||||
@ -28,96 +24,10 @@ describe "SPECDB::Common" do
|
||||
|
||||
db << car3
|
||||
db.data.keys.sort.should eq([0, 2, 3] of Int32)
|
||||
db.lru.to_s.should eq "[ 3, 0, 2 ]"
|
||||
db.fifo.to_s.should eq "[ 3, 0, 2 ]"
|
||||
|
||||
db.delete 2
|
||||
db.data.keys.sort.should eq([0, 3] of Int32)
|
||||
db.lru.to_s.should eq "[ 3, 0 ]"
|
||||
end
|
||||
|
||||
it "add some values, reindex, check the values" do
|
||||
car0 = Car.new "Corvet-0", "red", [] of String
|
||||
car1 = Car.new "Corvet-1", "red", [] of String
|
||||
car2 = Car.new "Corvet-2", "red", [] of String
|
||||
car3 = Car.new "Corvet-3", "red", [] of String
|
||||
|
||||
db = SPECDB::Common(Car).new "reindex", 2
|
||||
index_name = db.new_index "name", &.name
|
||||
index_color = db.new_partition "color", &.color
|
||||
|
||||
db.data.keys.sort.should eq([] of Int32)
|
||||
|
||||
db << car0
|
||||
db.data.keys.sort.should eq([0] of Int32)
|
||||
|
||||
db << car1
|
||||
db.data.keys.sort.should eq([0, 1] of Int32)
|
||||
db.lru.to_s.should eq "[ 1, 0 ]"
|
||||
|
||||
db.data.keys.sort.should eq([0, 1] of Int32)
|
||||
db.lru.to_s.should eq "[ 1, 0 ]"
|
||||
|
||||
db << car2
|
||||
db.data.keys.sort.should eq([1, 2] of Int32)
|
||||
db.lru.to_s.should eq "[ 2, 1 ]"
|
||||
db[0] # Let's use the first value, it shouldn't be the one to be dropped.
|
||||
|
||||
db << car3
|
||||
db.data.keys.sort.should eq([0, 3] of Int32)
|
||||
db.lru.to_s.should eq "[ 3, 0 ]"
|
||||
|
||||
# Actually remove the value indexed "2".
|
||||
db.delete 2
|
||||
# The "delete" action actually puts the value in the cache before removing it.
|
||||
db.data.keys.sort.should eq([3] of Int32)
|
||||
db.lru.to_s.should eq "[ 3 ]"
|
||||
|
||||
# db2: further tests for the LRU behavior, with `reindex_everything!` for example.
|
||||
db2 = SPECDB::Common(Car).new "reindex", 2, false
|
||||
index2_name = db2.new_index "name", &.name
|
||||
|
||||
# For now, we didn't use any value in the database.
|
||||
# Also, triggers should have empty caches.
|
||||
db2.data.keys.sort.should eq([] of Int32)
|
||||
db2.lru.to_s.should eq "[ ]"
|
||||
index2_name.get?("Corvet-0").should eq car0
|
||||
|
||||
# Reindex removes all triggers (hard rm -rf trigger-dir) then reads all
|
||||
# data from the file-system to run the triggers. Data is put into the cache
|
||||
# of the `Common` database.
|
||||
db2.reindex_everything!
|
||||
|
||||
# Values 1 and 3 are the last recently used values following `reindex_everything!`.
|
||||
db2.data.keys.sort.should eq([1, 3] of Int32)
|
||||
db2.lru.to_s.should eq "[ 3, 1 ]"
|
||||
|
||||
total_values = 0
|
||||
db2.each_with_key do |v, k|
|
||||
total_values += 1
|
||||
end
|
||||
total_values.should eq 3
|
||||
|
||||
# db3: no need for a reindex to access values from the database,
|
||||
# with `each` or `each_with_key` for example.
|
||||
db3 = SPECDB::Common(Car).new "reindex", 2, false
|
||||
total_values = 0
|
||||
db3.each do |v|
|
||||
total_values += 1
|
||||
end
|
||||
total_values.should eq 3
|
||||
|
||||
# db4: no need for a reindex to access values from triggers.
|
||||
db4 = SPECDB::Common(Car).new "reindex", 2, false
|
||||
index4_name = db4.new_index "name", &.name
|
||||
index4_color = db4.new_partition "color", &.color
|
||||
|
||||
index4_name.data.size.should eq 0 # trigger cache is empty
|
||||
index4_name.get?("Corvet-3").should eq car3
|
||||
index4_name.data.size.should eq 1 # trigger cache: one value, Corvet-3
|
||||
|
||||
index4_color.data.size.should eq 0 # trigger cache is empty
|
||||
index4_color.get("red").size.should eq 3 # read from the disk
|
||||
index4_color.data.size.should eq 1 # trigger cache: 1, the color "red"
|
||||
index4_color.data["red"].size.should eq 3 # 3 values in "red"
|
||||
db.fifo.to_s.should eq "[ 3, 0 ]"
|
||||
end
|
||||
end
|
||||
|
54
spec/test-fifo.cr
Normal file
54
spec/test-fifo.cr
Normal file
@ -0,0 +1,54 @@
|
||||
require "spec"
|
||||
require "../src/fifo.cr"
|
||||
|
||||
describe "FIFO" do
|
||||
it "add and remove values" do
|
||||
fifo = FIFO(Int32).new 3 # Only 3 allowed entries.
|
||||
(fifo << 1).should be_nil # there is still room in the fifo
|
||||
(fifo << 2).should be_nil # there is still room in the fifo
|
||||
(fifo << 3).should be_nil # last entry without exceeding the allowed size
|
||||
(fifo << 4).should eq 1 # -> 1 (least recently used data)
|
||||
(fifo << 4).should be_nil # -> nil (already in the fifo)
|
||||
(fifo << 2).should be_nil # -> nil (already in the fifo)
|
||||
(fifo << 5).should eq 3 # -> 3 (least recently used data)
|
||||
fifo.data.should eq([5, 2, 4] of Int32)
|
||||
|
||||
fifo.delete 2
|
||||
fifo.data.should eq([5, 4] of Int32)
|
||||
end
|
||||
end
|
||||
|
||||
describe "EfficientFIFO" do
|
||||
it "add and remove values" do
|
||||
fifo = EfficientFIFO(Int32).new 3 # Only 3 allowed entries.
|
||||
(fifo << 1).should be_nil # there is still room in the fifo
|
||||
(fifo << 2).should be_nil # there is still room in the fifo
|
||||
(fifo << 3).should be_nil # last entry without exceeding the allowed size
|
||||
(fifo << 4).should eq 1 # -> 1 (least recently used data)
|
||||
(fifo << 4).should be_nil # -> nil (already in the fifo)
|
||||
(fifo << 2).should be_nil # -> nil (already in the fifo)
|
||||
(fifo << 5).should eq 3 # -> 3 (least recently used data)
|
||||
fifo.list.to_s.should eq "[ 5, 2, 4 ]"
|
||||
|
||||
fifo.delete 2
|
||||
fifo.list.to_s.should eq "[ 5, 4 ]"
|
||||
|
||||
(fifo << 4).should be_nil # -> nil (just a re-order)
|
||||
fifo.list.to_s.should eq "[ 4, 5 ]"
|
||||
|
||||
fifo.delete 5
|
||||
(fifo << 0).should be_nil
|
||||
fifo.list.to_s.should eq "[ 0, 4 ]"
|
||||
|
||||
(fifo << 1).should be_nil
|
||||
fifo.list.to_s.should eq "[ 1, 0, 4 ]"
|
||||
|
||||
fifo.delete 4
|
||||
fifo.list.to_s.should eq "[ 1, 0 ]"
|
||||
|
||||
fifo.delete 4
|
||||
fifo.list.to_s.should eq "[ 1, 0 ]"
|
||||
fifo.list.size.should eq 2
|
||||
fifo.hash.size.should eq 2
|
||||
end
|
||||
end
|
@ -1,54 +0,0 @@
|
||||
require "spec"
|
||||
require "../src/lru.cr"
|
||||
|
||||
describe "LRU" do
|
||||
it "add and remove values" do
|
||||
lru = LRU(Int32).new 3 # Only 3 allowed entries.
|
||||
(lru << 1).should be_nil # there is still room in the lru
|
||||
(lru << 2).should be_nil # there is still room in the lru
|
||||
(lru << 3).should be_nil # last entry without exceeding the allowed size
|
||||
(lru << 4).should eq 1 # -> 1 (least recently used data)
|
||||
(lru << 4).should be_nil # -> nil (already in the lru)
|
||||
(lru << 2).should be_nil # -> nil (already in the lru)
|
||||
(lru << 5).should eq 3 # -> 3 (least recently used data)
|
||||
lru.data.should eq([5, 2, 4] of Int32)
|
||||
|
||||
lru.delete 2
|
||||
lru.data.should eq([5, 4] of Int32)
|
||||
end
|
||||
end
|
||||
|
||||
describe "EfficientLRU" do
|
||||
it "add and remove values" do
|
||||
lru = EfficientLRU(Int32).new 3 # Only 3 allowed entries.
|
||||
(lru << 1).should be_nil # there is still room in the lru
|
||||
(lru << 2).should be_nil # there is still room in the lru
|
||||
(lru << 3).should be_nil # last entry without exceeding the allowed size
|
||||
(lru << 4).should eq 1 # -> 1 (least recently used data)
|
||||
(lru << 4).should be_nil # -> nil (already in the lru)
|
||||
(lru << 2).should be_nil # -> nil (already in the lru)
|
||||
(lru << 5).should eq 3 # -> 3 (least recently used data)
|
||||
lru.list.to_s.should eq "[ 5, 2, 4 ]"
|
||||
|
||||
lru.delete 2
|
||||
lru.list.to_s.should eq "[ 5, 4 ]"
|
||||
|
||||
(lru << 4).should be_nil # -> nil (just a re-order)
|
||||
lru.list.to_s.should eq "[ 4, 5 ]"
|
||||
|
||||
lru.delete 5
|
||||
(lru << 0).should be_nil
|
||||
lru.list.to_s.should eq "[ 0, 4 ]"
|
||||
|
||||
(lru << 1).should be_nil
|
||||
lru.list.to_s.should eq "[ 1, 0, 4 ]"
|
||||
|
||||
lru.delete 4
|
||||
lru.list.to_s.should eq "[ 1, 0 ]"
|
||||
|
||||
lru.delete 4
|
||||
lru.list.to_s.should eq "[ 1, 0 ]"
|
||||
lru.list.size.should eq 2
|
||||
lru.hash.size.should eq 2
|
||||
end
|
||||
end
|
@ -1,58 +0,0 @@
|
||||
require "spec"
|
||||
require "./db-cars.cr"
|
||||
|
||||
class DODB::Trigger::Virtual(V) < DODB::Trigger(V)
|
||||
# Indexes a value, used for **internal operations**.
|
||||
def index(key : String, value : V)
|
||||
puts "index: key #{key}, value #{value}"
|
||||
end
|
||||
|
||||
# Removes the index of a value, used for **internal operations**.
|
||||
def deindex(key : String, value : V)
|
||||
puts "deindex: key #{key}, value #{value}"
|
||||
end
|
||||
|
||||
# Verifies whether a new value will create a collision with the index of
|
||||
# currently stored value, used for **internal operations**.
|
||||
def check!(key : String, value : V, old_value : V?)
|
||||
puts "check!: key #{key}, value #{value}, old_value #{old_value}"
|
||||
false
|
||||
end
|
||||
|
||||
# Name of the index, such as *id* or *color* for example.
|
||||
# This is an arbitrary value, mostly to create the index directory.
|
||||
def name : String
|
||||
name = "some name"
|
||||
puts "name: #{name}"
|
||||
name
|
||||
end
|
||||
|
||||
# Directory where the values will be written.
|
||||
def trigger_directory : String
|
||||
dir = "something"
|
||||
puts "trigger directory: #{dir}"
|
||||
dir
|
||||
end
|
||||
|
||||
# Removes all the index entries, removes the `#trigger_directory` by default.
|
||||
def nuke_trigger
|
||||
puts "nuke trigger"
|
||||
end
|
||||
end
|
||||
|
||||
car0 = Car.new "Corvet-0", "red", [] of String
|
||||
car1 = Car.new "Corvet-1", "red", [] of String
|
||||
car2 = Car.new "Corvet-2", "red", [] of String
|
||||
car3 = Car.new "Corvet-3", "red", [] of String
|
||||
|
||||
db = SPECDB::Common(Car).new "test-triggers", 2
|
||||
db.triggers << DODB::Trigger::Virtual(Car).new
|
||||
db << car0
|
||||
db.delete 0
|
||||
db << car0
|
||||
db << car1
|
||||
carm = car1
|
||||
carm.name = "modified"
|
||||
db << carm
|
||||
db << car2
|
||||
db << car3
|
@ -1,97 +0,0 @@
|
||||
class Context
|
||||
class_property report_dir = "results"
|
||||
class_property max_indexes = 5_000
|
||||
class_property nb_run = 100
|
||||
class_property from = 1_000
|
||||
class_property to = 50_000
|
||||
class_property incr = 1_000
|
||||
class_property lru_size : UInt32 = 10_000
|
||||
end
|
||||
|
||||
# To simplify the creation of graphs, it's better to have fake data for
|
||||
# partitions and tags that won't be actually covered.
|
||||
# 0 means the absence of data.
|
||||
def fake_report(name)
|
||||
durations = Array(Int32).new Context.nb_run, 0
|
||||
File.open("#{Context.report_dir}/#{name}.raw", "w") do |file|
|
||||
durations.each do |d|
|
||||
file.puts d
|
||||
end
|
||||
end
|
||||
puts "#{name}: no report"
|
||||
end
|
||||
def report(storage, name, &block)
|
||||
durations = run_n_times Context.nb_run, &block
|
||||
File.open("#{Context.report_dir}/#{name}.raw", "w") do |file|
|
||||
durations.each do |d|
|
||||
file.puts d
|
||||
end
|
||||
end
|
||||
avr = durations.reduce { |a, b| a + b } / Context.nb_run
|
||||
puts "#{name}: #{avr}"
|
||||
avr
|
||||
end
|
||||
|
||||
def verbose_add_cars(storage, nbcars, name, max_indexes)
|
||||
long_operation "add #{nbcars} values to #{name}" do
|
||||
add_cars storage, nbcars, max_indexes: max_indexes
|
||||
end
|
||||
end
|
||||
|
||||
# Add first entries, then loop: speed tests, add entries.
|
||||
def prepare_env(storage, name, s_index, s_partition, s_tags, &)
|
||||
verbose_add_cars storage, Context.from, name, max_indexes: Context.max_indexes
|
||||
|
||||
current = Context.from
|
||||
to = Context.to
|
||||
incr = Context.incr
|
||||
|
||||
while current < to
|
||||
puts "current number of cars: #{current}/#{to}"
|
||||
yield storage, current, name, s_index, s_partition, s_tags
|
||||
|
||||
break if current + incr >= to
|
||||
|
||||
verbose_add_cars storage, incr, name, max_indexes: Context.max_indexes
|
||||
current += incr
|
||||
end
|
||||
|
||||
long_operation "removing #{name} data" { storage.rm_storage_dir }
|
||||
end
|
||||
|
||||
def perform_add(storage : DODB::Storage(Car))
|
||||
corvet0 = Car.new "Corvet", "red", [ "shiny", "impressive", "fast", "elegant" ]
|
||||
i = 0
|
||||
perform_benchmark_average Context.nb_run, do
|
||||
corvet = corvet0.clone
|
||||
corvet.name = "Corvet-#{i}"
|
||||
storage.unsafe_add corvet
|
||||
i += 1
|
||||
end
|
||||
end
|
||||
|
||||
def search_benchmark(storage : DODB::Storage(Car),
|
||||
current_db_size : Int32,
|
||||
name : String,
|
||||
search_name : DODB::Trigger::Index(Car),
|
||||
search_color : DODB::Trigger::Partition(Car),
|
||||
search_keywords : DODB::Trigger::Tags(Car))
|
||||
name_to_search = ENV["CARNAME"] rescue "Corvet-#{(current_db_size/2).to_i}"
|
||||
color_to_search = ENV["CARCOLOR"] rescue "red"
|
||||
keyword_to_search = ENV["CARKEYWORD"] rescue "spacious"
|
||||
puts "NEW BATCH: db-size #{current_db_size}, name: '#{name_to_search}', color: '#{color_to_search}', tag: '#{keyword_to_search}'"
|
||||
report(storage, "#{name}_#{current_db_size}_index") do
|
||||
corvet = search_name.get name_to_search
|
||||
end
|
||||
if current_db_size <= Context.max_indexes
|
||||
report(storage, "#{name}_#{current_db_size}_partitions") do
|
||||
corvet = search_color.get? color_to_search
|
||||
end
|
||||
report(storage, "#{name}_#{current_db_size}_tags") do
|
||||
corvet = search_keywords.get? keyword_to_search
|
||||
end
|
||||
else
|
||||
fake_report("#{name}_#{current_db_size}_partitions")
|
||||
fake_report("#{name}_#{current_db_size}_tags")
|
||||
end
|
||||
end
|
@ -1,6 +1,6 @@
|
||||
require "file_utils"
|
||||
require "json"
|
||||
|
||||
require "./lru.cr" # LRU class to implement a cache policy.
|
||||
require "./fifo.cr" # FIFO class to implement a cache policy.
|
||||
require "./list.cr" # Double Linked List.
|
||||
require "./dodb/*" # Databases and indexes (basic indexes, partitions, tags, etc.).
|
||||
|
@ -2,7 +2,7 @@
|
||||
# subsequent DODB databases (uncached, cached, RAM-only, etc.).
|
||||
abstract class DODB::Storage(V)
|
||||
# List of triggers (basic indexes, partitions, tags, etc.).
|
||||
property triggers = [] of Trigger(V)
|
||||
@triggers = [] of Trigger(V)
|
||||
|
||||
property cached_last_key : Int32
|
||||
|
||||
@ -344,7 +344,7 @@ abstract class DODB::Storage(V)
|
||||
Dir.mkdir_p data_path
|
||||
end
|
||||
|
||||
private def nuke_triggers!
|
||||
private def remove_triggers!
|
||||
@triggers.each do |trigger|
|
||||
trigger.nuke_trigger
|
||||
end
|
||||
@ -354,7 +354,7 @@ abstract class DODB::Storage(V)
|
||||
#
|
||||
# WARNING: slow operation.
|
||||
def reindex_everything!
|
||||
nuke_triggers!
|
||||
remove_triggers!
|
||||
|
||||
each_with_key() do |item, key|
|
||||
run_triggers key, item
|
||||
@ -436,9 +436,9 @@ abstract class DODB::Storage(V)
|
||||
end
|
||||
|
||||
# Lists all the keys in the database.
|
||||
def each_key_from_fs(reversed = false)
|
||||
private def each_key(reversed = false)
|
||||
# Removes the first two "." and ".." directories.
|
||||
keys = Dir.children(data_path).map(&.to_i).sort
|
||||
keys = Dir.entries(data_path).[2..].map(&.to_i).sort
|
||||
(reversed ? keys.reverse : keys).each do |key|
|
||||
yield key
|
||||
end
|
||||
@ -455,7 +455,7 @@ abstract class DODB::Storage(V)
|
||||
-1
|
||||
end
|
||||
|
||||
each_key_from_fs(reversed) do |key|
|
||||
each_key(reversed) do |key|
|
||||
offset -= 1 if offset >= 0
|
||||
next if offset >= 0
|
||||
|
||||
|
@ -12,8 +12,8 @@
|
||||
# constantly ask for the same data over and over.
|
||||
#
|
||||
# ```
|
||||
# # Creates a DODB database for common usage (a limited number of cached entries: 100k).
|
||||
# car_database = DODB::Storage::Common.new "/path/to/db", 100_000
|
||||
# # Creates a DODB database for common usage (a limited number of cached entries).
|
||||
# car_database = DODB::Storage::Common.new "/path/to/db"
|
||||
#
|
||||
# # Creates a (cached) index.
|
||||
# cars_by_name = car_database.new_index "name", &.name
|
||||
@ -33,13 +33,13 @@
|
||||
#
|
||||
# NOTE: fast for frequently requested data and requires a stable (and configurable) amount of memory.
|
||||
class DODB::Storage::Common(V) < DODB::Storage::Cached(V)
|
||||
# The *lru* is an instance of `EfficientLRU` where the key of the requested data is pushed.
|
||||
# The *fifo* is an instance of `EfficientFIFO` where the key of the requested data is pushed.
|
||||
# In case the number of stored entries exceeds what is allowed, the least recently used entry is removed.
|
||||
property lru : EfficientLRU(Int32)
|
||||
property fifo : EfficientFIFO(Int32)
|
||||
|
||||
# Initializes the `DODB::Storage::Common` database with a maximum number of entries in the cache.
|
||||
def initialize(@directory_name : String, max_entries : UInt32)
|
||||
@lru = EfficientLRU(Int32).new max_entries
|
||||
@fifo = EfficientFIFO(Int32).new max_entries
|
||||
Dir.mkdir_p data_path
|
||||
Dir.mkdir_p locks_directory
|
||||
|
||||
@ -47,7 +47,7 @@ class DODB::Storage::Common(V) < DODB::Storage::Cached(V)
|
||||
end
|
||||
|
||||
# Verifies that the value is in cache, or read it on disk.
|
||||
# Pushes the key in the lru.
|
||||
# Pushes the key in the fifo.
|
||||
def [](key : Int32) : V
|
||||
val = @data[key]?
|
||||
if val.nil?
|
||||
@ -55,14 +55,14 @@ class DODB::Storage::Common(V) < DODB::Storage::Cached(V)
|
||||
val = read file_path key
|
||||
@data[key] = val
|
||||
end
|
||||
push_lru key
|
||||
push_fifo key
|
||||
val
|
||||
end
|
||||
|
||||
# Assumes new entries are more requested than old ones.
|
||||
def []=(key : Int32, value : V)
|
||||
super key, value
|
||||
push_lru key
|
||||
push_fifo key
|
||||
end
|
||||
|
||||
# :inherit:
|
||||
@ -70,48 +70,20 @@ class DODB::Storage::Common(V) < DODB::Storage::Cached(V)
|
||||
# Assumes new entries are more requested than old ones.
|
||||
def <<(item : V)
|
||||
key = super item
|
||||
push_lru key
|
||||
push_fifo key
|
||||
end
|
||||
|
||||
def unsafe_delete(key : Int32)
|
||||
@lru.delete key if super key
|
||||
@fifo.delete key if super key
|
||||
end
|
||||
|
||||
def delete(key : Int32)
|
||||
@lru.delete key if super key
|
||||
@fifo.delete key if super key
|
||||
end
|
||||
|
||||
private def push_lru(key : Int32)
|
||||
if entry_to_remove = @lru << key
|
||||
# Remove the data from the cache but doesn't remove the indexes.
|
||||
private def push_fifo(key : Int32)
|
||||
if entry_to_remove = @fifo << key
|
||||
@data.delete entry_to_remove
|
||||
end
|
||||
end
|
||||
|
||||
# Function `each_with_key` is a rewrite of the parent.
|
||||
# The `Common` database doesn't keep all entries in memory, data has to be read from disk.
|
||||
def each_with_key(reversed : Bool = false, offset = 0, limit : Int32? = -1)
|
||||
limit = if l = limit
|
||||
l
|
||||
else
|
||||
-1
|
||||
end
|
||||
|
||||
each_key_from_fs(reversed) do |key|
|
||||
offset -= 1 if offset >= 0
|
||||
next if offset >= 0
|
||||
|
||||
return if limit == 0
|
||||
limit -= 1 if limit > 0
|
||||
|
||||
begin
|
||||
# FIXME: Only intercept JSON parsing errors.
|
||||
value = self[key]
|
||||
rescue
|
||||
next
|
||||
end
|
||||
|
||||
yield value, key
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -256,25 +256,12 @@ class DODB::Trigger::Index(V) < DODB::Trigger(V)
|
||||
# # Deletes the car named "Corvet".
|
||||
# car_by_name.delete "Corvet"
|
||||
# ```
|
||||
# WARNING: may throw a MissingEntry exception.
|
||||
def delete(index : String)
|
||||
key = get_key index
|
||||
|
||||
@storage.delete key
|
||||
end
|
||||
|
||||
# Deletes a value based on its index, but do ignores a MissingEntry error.
|
||||
#
|
||||
# ```
|
||||
# # Deletes the car named "Corvet" (no MissingEntry exception if the car doesn't exist).
|
||||
# car_by_name.delete? "Corvet"
|
||||
# ```
|
||||
def delete?(v : String)
|
||||
delete v
|
||||
rescue MissingEntry
|
||||
nil
|
||||
end
|
||||
|
||||
# :inherit:
|
||||
def trigger_directory : String
|
||||
"#{@storage_root}/indices/by_#{@name}"
|
||||
|
@ -153,18 +153,6 @@ class DODB::Trigger::Partition(V) < DODB::Trigger(V)
|
||||
delete partition, do true end
|
||||
end
|
||||
|
||||
# Deletes all entries within the provided partition, but do ignores a MissingEntry error.
|
||||
#
|
||||
# ```
|
||||
# # Deletes all red cars.
|
||||
# cars_by_color.delete? "red" # no MissingEntry exception if there is no red cars
|
||||
# ```
|
||||
def delete?(partition : String)
|
||||
delete partition
|
||||
rescue MissingEntry
|
||||
nil
|
||||
end
|
||||
|
||||
# Deletes entries within the provided partition and matching the provided block of code.
|
||||
#
|
||||
# ```
|
||||
|
@ -187,22 +187,9 @@ class DODB::Trigger::Tags(V) < DODB::Trigger(V)
|
||||
# cars_by_keywords.delete "slow" # Deletes all slow cars.
|
||||
# cars_by_keywords.delete ["slow", "expensive"] # Deletes all cars that are both slow and expensive.
|
||||
# ```
|
||||
# WARNING: throws a MissingEntry exception if no value is found.
|
||||
def delete(tag_or_tags : String | Array(String))
|
||||
delete tag_or_tags, do true end
|
||||
end
|
||||
|
||||
# Deletes all entries with the provided tag, but do ignores a MissingEntry error.
|
||||
#
|
||||
# ```
|
||||
# # No MissingEntry exception will be thrown.
|
||||
# cars_by_keywords.delete? "slow" # Deletes all slow cars.
|
||||
# cars_by_keywords.delete? ["slow", "expensive"] # Deletes all cars that are both slow and expensive.
|
||||
# ```
|
||||
def delete?(tag_or_tags : String | Array(String))
|
||||
delete tag_or_tags
|
||||
rescue MissingEntry
|
||||
nil
|
||||
# WARNING: throws an exception if no value is found.
|
||||
def delete(tag : String | Array(String))
|
||||
delete tag, do true end
|
||||
end
|
||||
|
||||
# Deletes entries within the provided tag index and matching the provided block of code.
|
||||
|
@ -1,31 +1,31 @@
|
||||
require "./list.cr"
|
||||
|
||||
# This class is a simpler implementation of `EfficientLRU`, used to implement an eviction policy for data cache
|
||||
# This class is a simpler implementation of `EfficientFIFO`, used to implement an eviction policy for data cache
|
||||
# for `DODB::Storage::Common`.
|
||||
# It enables to keep track of recently used data.
|
||||
#
|
||||
# **How this works**.
|
||||
# Each time a value is added in the database, its key is put in this "LRU" structure.
|
||||
# Each time a value is added in the database, its key is put in this "FIFO" structure.
|
||||
# In this structure, **values are unique** and adding a value several times is considered as "using the value",
|
||||
# so it is pushed back at the entry of the LRU structure, as a new value.
|
||||
# so it is pushed back at the entry of the FIFO structure, as a new value.
|
||||
# In case the number of entries exceeds what is allowed, the least recently used value is removed.
|
||||
# ```
|
||||
# lru = LRU(Int32).new 3 # Only 3 allowed entries.
|
||||
# fifo = FIFO(Int32).new 3 # Only 3 allowed entries.
|
||||
#
|
||||
# pp! lru << 1 # -> nil (there is still room in the LRU structure)
|
||||
# pp! lru << 2 # -> nil (there is still room in the LRU structure)
|
||||
# pp! lru << 3 # -> nil (last entry without exceeding the allowed size)
|
||||
# pp! lru << 4 # -> 1 (least recently used data)
|
||||
# pp! lru << 4 # -> nil (already in the structure)
|
||||
# pp! lru << 2 # -> nil (already in the structure)
|
||||
# pp! lru << 5 # -> 3 (least recently used data)
|
||||
# pp! fifo << 1 # -> nil (there is still room in the FIFO structure)
|
||||
# pp! fifo << 2 # -> nil (there is still room in the FIFO structure)
|
||||
# pp! fifo << 3 # -> nil (last entry without exceeding the allowed size)
|
||||
# pp! fifo << 4 # -> 1 (least recently used data)
|
||||
# pp! fifo << 4 # -> nil (already in the structure)
|
||||
# pp! fifo << 2 # -> nil (already in the structure)
|
||||
# pp! fifo << 5 # -> 3 (least recently used data)
|
||||
# ```
|
||||
#
|
||||
# The number of entries in the LRU structure is configurable.
|
||||
# The number of entries in the FIFO structure is configurable.
|
||||
# WARNING: this implementation becomes slow very fast (0(n) complexity), but doesn't cost much memory.
|
||||
# WARNING: this *LRU* class doesn't allow the same value multiple times.
|
||||
class LRU(V)
|
||||
# This array is used as the *lru structure*.
|
||||
# WARNING: this *FIFO* class doesn't allow the same value multiple times.
|
||||
class FIFO(V)
|
||||
# This array is used as the *fifo structure*.
|
||||
property data : Array(V)
|
||||
|
||||
# Maximum allowed entries in the structure.
|
||||
@ -35,7 +35,7 @@ class LRU(V)
|
||||
@data = Array(V).new
|
||||
end
|
||||
|
||||
# Pushes a value in the LRU and gets the oldest value whether it exceeds the allowed number of entries.
|
||||
# Pushes a value in the FIFO and gets the oldest value whether it exceeds the allowed number of entries.
|
||||
# NOTE: `#<<(v : V)` is (almost) the only function since it's enough for the intended use, feel free to improve this.
|
||||
# WARNING: implementation is extremely simple (3 lines) and not designed to be highly efficient.
|
||||
def <<(v : V) : V?
|
||||
@ -58,32 +58,32 @@ end
|
||||
# It enables to keep track of recently used data.
|
||||
#
|
||||
# **How this works**.
|
||||
# Each time a value is added in the database, its key is put in this "LRU" structure.
|
||||
# Each time a value is added in the database, its key is put in this "FIFO" structure.
|
||||
# In this structure, **values are unique** and adding a value several times is considered as "using the value",
|
||||
# so it is pushed back at the entry of the LRU structure, as a new value.
|
||||
# so it is pushed back at the entry of the FIFO structure, as a new value.
|
||||
# In case the number of entries exceeds what is allowed, the least recently used value is removed.
|
||||
# ```
|
||||
# lru = EfficientLRU(Int32).new 3 # Only 3 allowed entries.
|
||||
# fifo = EfficientFIFO(Int32).new 3 # Only 3 allowed entries.
|
||||
#
|
||||
# pp! lru << 1 # -> nil (there is still room in the LRU structure)
|
||||
# pp! lru << 2 # -> nil (there is still room in the LRU structure)
|
||||
# pp! lru << 3 # -> nil (last entry without exceeding the allowed size)
|
||||
# pp! lru << 4 # -> 1 (least recently used data)
|
||||
# pp! lru << 4 # -> nil (already in the structure)
|
||||
# pp! lru << 2 # -> nil (already in the structure)
|
||||
# pp! lru << 5 # -> 3 (least recently used data)
|
||||
# pp! fifo << 1 # -> nil (there is still room in the FIFO structure)
|
||||
# pp! fifo << 2 # -> nil (there is still room in the FIFO structure)
|
||||
# pp! fifo << 3 # -> nil (last entry without exceeding the allowed size)
|
||||
# pp! fifo << 4 # -> 1 (least recently used data)
|
||||
# pp! fifo << 4 # -> nil (already in the structure)
|
||||
# pp! fifo << 2 # -> nil (already in the structure)
|
||||
# pp! fifo << 5 # -> 3 (least recently used data)
|
||||
# ```
|
||||
#
|
||||
# **Implementation details.**
|
||||
# Contrary to the `LRU` class, this implementation is time-efficient.
|
||||
# Contrary to the `FIFO` class, this implementation is time-efficient.
|
||||
# However, this efficiency is a memory tradeoff: all the entries are added to a double-linked list to keep
|
||||
# track of the order **and** to a hash to perform efficient searches of the values in the double-linked list.
|
||||
# Thus, all the nodes are added twice, once in the list, once in the hash.
|
||||
#
|
||||
# The number of entries in the LRU structure is configurable.
|
||||
# The number of entries in the FIFO structure is configurable.
|
||||
# NOTE: this implementation is time-efficient, but costs some memory.
|
||||
class EfficientLRU(V)
|
||||
# Both this list and the hash are used as the *lru structures*.
|
||||
class EfficientFIFO(V)
|
||||
# Both this list and the hash are used as the *fifo structures*.
|
||||
# The list preserves the *order* of the entries while the *hash* enables fast retrieval of entries in the list.
|
||||
property list : DoubleLinkedList(V)
|
||||
property hash : Hash(V, DoubleLinkedList::Node(V))
|
||||
@ -93,7 +93,7 @@ class EfficientLRU(V)
|
||||
@hash = Hash(V, DoubleLinkedList::Node(V)).new
|
||||
end
|
||||
|
||||
# Pushes a value in the LRU and gets the oldest value whether it exceeds the allowed number of entries.
|
||||
# Pushes a value in the FIFO and gets the oldest value whether it exceeds the allowed number of entries.
|
||||
# NOTE: `#<<(v : V)` is (almost) the only function since it's enough for the intended use, feel free to improve this.
|
||||
def <<(v : V) : V?
|
||||
if node = hash[v]?
|
Loading…
Reference in New Issue
Block a user