[ADD/WIP] Test out LMDB

Separate branch because I'm mainly testing reliability. Seek out
lda/Cytoplasm's lmdbwerk branch for the base upstream(with mem-moment's
Memory.c impl to apply)
This commit is contained in:
LDA 2024-08-10 10:40:36 +02:00
commit 2a09bd7156
3 changed files with 9 additions and 2 deletions

View file

@ -65,8 +65,9 @@ TODO
pulls in *way too many* dependencies, and that lacks a C binding. We may pulls in *way too many* dependencies, and that lacks a C binding. We may
put in the work of either forking off libolm or making a binding to KappaChat. put in the work of either forking off libolm or making a binding to KappaChat.
- Mess with Cytoplasm to make it have support for something like LMDB as an ~ Mess with Cytoplasm to make it have support for something like LMDB as an
*optional* dependency. This should increase reliability and speed for anyone. *optional* dependency. This should increase reliability and speed for anyone.
v Work is going on on the Cytoplasm `lmdbwerk` and this branch to get LMDB.
- Nesting might be an issue we'll need to deal with. libdb and Berkley DB - Nesting might be an issue we'll need to deal with. libdb and Berkley DB
seem to lack support for them. If we can shove entries at specific indices, seem to lack support for them. If we can shove entries at specific indices,
we _might_ just manage to get some system that can at least emulate that, we _might_ just manage to get some system that can at least emulate that,

View file

@ -27,7 +27,7 @@ ParseeInitData(XMPPComponent *comp)
data->router = HttpRouterCreate(); data->router = HttpRouterCreate();
data->jabber = comp; data->jabber = comp;
data->handler = CommandCreateRouter(); data->handler = CommandCreateRouter();
data->db = DbOpen(data->config->db_path, 0); data->db = DbOpenLMDB(data->config->db_path, 64 MB);
#define X_ROUTE(path, func) do {\ #define X_ROUTE(path, func) do {\
if (!HttpRouterAdd(data->router, path, func))\ if (!HttpRouterAdd(data->router, path, func))\

View file

@ -65,6 +65,12 @@ typedef struct ParseeData {
#define MINUTES * 60 SECONDS #define MINUTES * 60 SECONDS
#define HOURS * 60 MINUTES #define HOURS * 60 MINUTES
/* Size units(using 2^10 as a reference), to be used like the time units */
#define B * 1
#define KB * 1024 B
#define MB * 1024 KB
#define GB * 1024 MB
/* Initialises a Parsee config from scratch, and writes to it /* Initialises a Parsee config from scratch, and writes to it
* as JSON in the CWD. */ * as JSON in the CWD. */
extern void ParseeConfigInit(void); extern void ParseeConfigInit(void);