nostrdb

an unfairly fast embedded nostr database backed by lmdb
git clone git://jb55.com/nostrdb
Log | Files | Refs | Submodules | README | LICENSE

commit 9f2ee7898e20a0182b2cd6bd6e4c3d1ac3aabcb4
parent c0d2b49ab813010ed18bd9cf8980141a30f591ad
Author: William Casarin <jb55@jb55.com>
Date:   Fri,  1 Dec 2023 13:17:25 -0800

config: fix ingester thread settings

Diffstat:
Mnostrdb.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/nostrdb.c b/nostrdb.c @@ -4398,8 +4398,9 @@ inline int ndb_builder_push_tag_str(struct ndb_builder *builder, // void ndb_default_config(struct ndb_config *config) { + int cores = get_physical_cores(); config->mapsize = 1024UL * 1024UL * 1024UL * 32UL; // 32 GiB - config->ingester_threads = 4; // TODO: figure this out from platform apis + config->ingester_threads = cores == -1 ? 4 : cores; config->flags = 0; config->ingest_filter = NULL; config->filter_context = NULL; @@ -4407,8 +4408,7 @@ void ndb_default_config(struct ndb_config *config) void ndb_config_set_ingest_threads(struct ndb_config *config, int threads) { - int cores = get_physical_cores(); - config->ingester_threads = cores == -1 ? 4 : cores; + config->ingester_threads = threads; } void ndb_config_set_flags(struct ndb_config *config, int flags)