Compare commits

..

36 commits

Author SHA1 Message Date
74e770db98 Small fixes. 2025-04-20 11:54:06 +02:00
cdf776d650 Minor changes. 2025-04-15 00:08:53 +02:00
5f3e8d3581 Almost finished!! 2025-04-13 18:31:13 +02:00
0f2cc6e9fc Feedback. 2025-04-13 03:37:47 +02:00
41cdefef46 Filesystem introduction. 2025-04-12 21:02:27 +02:00
a9cc12e096 More filesystem explanations. 2025-04-06 04:17:53 +02:00
a184fad40a Introduction to filesystems. 2025-04-05 15:54:38 +02:00
b9242b0aa7 Improvements. 2025-04-05 04:10:21 +02:00
493deef217 The review continues. 2025-04-03 14:42:48 +02:00
df565f0426 Introduction + s/hash/lookup table/ 2025-04-02 02:36:50 +02:00
b910319937 PAPER: conclusion and minor improvements. 2025-03-31 06:06:03 +02:00
69fc674a2a Minor sentence. 2025-03-12 04:33:54 +01:00
cdfaf3a006 Alternatives++. 2025-03-06 16:35:10 +01:00
bed189deba Filesystems. 2025-02-28 00:28:02 +01:00
c04104dce1 Introduction++ 2025-02-08 06:18:35 +01:00
7e20de3d0e Tag-based filesystems. 2025-02-07 05:27:39 +01:00
a10013f6a4 More exotic filesystems. 2025-02-07 04:43:59 +01:00
9c98dd33ce Limits of DODB++. 2025-02-06 03:48:43 +01:00
5dbc282027 Limits of DODB++. 2025-02-05 06:42:23 +01:00
f4ab8154f9 Alternatives++ 2025-02-03 08:54:02 +01:00
1c6ea90389 Alternatives++ 2025-02-03 06:27:47 +01:00
03ae174112 KS/KE 2025-02-02 07:59:40 +01:00
838c0e4494 Minor update. 2025-02-01 15:08:35 +01:00
b76ee308c1 Talking about filesystems. 2025-02-01 05:02:26 +01:00
78df769a29 Paper improved. Slowing reaching a first readable version. 2025-01-27 05:15:18 +01:00
b08c8d43d8 Rewrite. 2025-01-26 05:37:46 +01:00
d58856b9d8 Introduction++. 2025-01-25 05:07:00 +01:00
37eed486c0 Triggers 2025-01-24 17:14:11 +01:00
876df62269 Add a few explanations (basic stuff). 2025-01-24 06:11:40 +01:00
62236d9276 Enable nested bullets. 2025-01-24 00:02:35 +01:00
9cc958c026 netlibre explanation and data leak prevention methods. 2025-01-24 00:02:35 +01:00
3109ee3bba Data-leak++ 2025-01-24 00:02:35 +01:00
2db46f1525 FIFO -> LRU 2025-01-24 00:02:35 +01:00
4825d850dc Add missing files. 2025-01-24 00:02:35 +01:00
095f525a46 bin/ 2025-01-24 00:02:35 +01:00
56ebeb58c2 Paper, advanced draft. 2025-01-24 00:02:35 +01:00
4 changed files with 96 additions and 146 deletions

View file

@ -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

View file

@ -14,7 +14,91 @@ require "./db-cars.cr"
# ENV["MAXINDEXES"] rescue 5_000
# ENV["LRU_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 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
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
@ -38,6 +122,17 @@ def bench_searches()
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

View file

@ -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

View file

@ -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