Skip to content

Commit

Permalink
entity cache initial size and increment made configurable, fixed mac …
Browse files Browse the repository at this point in the history
…build, added conan build (#108)
  • Loading branch information
mrbald authored Dec 10, 2024
1 parent 98d9e5d commit bb7f759
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 128 deletions.
13 changes: 13 additions & 0 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[requires]
benchmark/1.8.4
fmt/10.2.1
boost/1.86.0

[generators]
CMakeDeps
CMakeToolchain

[options]
boost/*:shared=True
[layout]
cmake_layout
2 changes: 1 addition & 1 deletion examples/bidder/generator/ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

with open("../data/geo_campaign", "w") as file:
for geo_id, city, country in geo:
max_targetings = random.randint(1, max_campaigns/10)
max_targetings = random.randint(1, int(max_campaigns/10))
start_pos = random.randint(1, max_campaigns-max_targetings)
for i in range(start_pos, start_pos+max_targetings+1):
file.write("%d\t%d\n" % (geo_id, i))
Expand Down
2 changes: 1 addition & 1 deletion examples/bidder/generator/ico.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

file = open("../data/ico_campaign", "w")
for domain, ref_id in ico_domains:
max_targetings = random.randint(1, max_campaigns/10)
max_targetings = random.randint(1, int(max_campaigns/10))
start_pos = random.randint(1, max_campaigns-max_targetings)
for i in range(start_pos, start_pos+max_targetings+1):
file.write("%d\t%d\n" % (ref_id, i))
Expand Down
8 changes: 4 additions & 4 deletions examples/campaign/campaign_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,17 @@ struct BudgetManager {

template <typename Config = CampaignManagerConfig,
typename Memory = typename mpclmi::ipc::Shared,
typename Alloc = typename datacache::entity_cache<Memory, ipc::data::campaign_container, 67108864, CampaignBudget>::char_allocator >
typename Alloc = typename datacache::entity_cache<Memory, ipc::data::campaign_container, CampaignBudget>::char_allocator >
class CampaignCache {
using Cache = datacache::entity_cache<Memory, ipc::data::campaign_container, 67108864, CampaignBudget> ;
using Cache = datacache::entity_cache<Memory, ipc::data::campaign_container, CampaignBudget> ;
using Keys = vanilla::tagged_tuple<
typename ipc::data::campaign_entity<Alloc,CampaignBudget>::campaign_id_tag, uint32_t
>;
using CampaignTag = typename ipc::data::campaign_entity<Alloc,CampaignBudget>::campaign_id_tag;
using insert_handler_type = std::function<bool (const CampaignBudget *budget, uint32_t campaign_id)>;
using remove_handler_type = std::function<bool (uint32_t campaign_id)>;
public:
public:

public:
using DataCollection = std::vector<std::shared_ptr <CampaignBudget> >;
CampaignCache(const Config &config):
config{config}, cache(config.data().ipc_name)
Expand Down
Loading

0 comments on commit bb7f759

Please sign in to comment.