From 42cb6e2b446a2879cf9bf2f4642f926c15584cb3 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Wed, 17 Sep 2025 18:27:56 -0400 Subject: Beginnings of per-level cost modeling The total time required for each shard construction is now measured, and hooks have been added to InternalLevel to support the creation and use of per-level cost models. The appropriate calls to these functions are now made during reconstruction, but the scheduling process doesn't yet call them, nor are the models actually implemented. --- include/framework/structure/ExtensionStructure.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/framework/structure/ExtensionStructure.h') diff --git a/include/framework/structure/ExtensionStructure.h b/include/framework/structure/ExtensionStructure.h index 0fd737c..bb8a480 100644 --- a/include/framework/structure/ExtensionStructure.h +++ b/include/framework/structure/ExtensionStructure.h @@ -10,6 +10,7 @@ #pragma once #include +#include #include #include #include @@ -196,7 +197,13 @@ public: result.source_shards.emplace_back(shid.level_idx, raw_shard_ptr); } + + auto start = std::chrono::high_resolution_clock::now(); result.new_shard = std::make_shared(shards); + auto stop = std::chrono::high_resolution_clock::now(); + + result.runtime = std::chrono::duration_cast(stop- start).count(); + result.reccnt = result.new_shard->get_record_count(); return result; } @@ -218,6 +225,14 @@ public: return m_levels[0]->get_shard_count(); } + bool apply_reconstruction(reconstruction_results &recon, size_t version) { + bool res = append_shard(recon.new_shard, version, recon.target_level); + m_levels[recon.target_level]->update_reconstruction_model(recon); + delete_shards(recon.source_shards); + + return res; + } + bool append_shard(std::shared_ptr shard, size_t version, size_t level) { assert(level <= m_levels.size()); auto rc = false; -- cgit v1.2.3