qdbm tuning (was: Experience with 0.15.2)
matthias.andree at gmx.de
Mon Sep 8 12:50:08 EDT 2003
Stefan Bellon <sbellon at sbellon.de> writes:
> 1) In src/datastore.c two casts have been introduced in the loops in
> line 157 and line 213. I get the following errors:
> "c.datastore", line 157: Error: objects that have been cast are
> not l-values
> "c.datastore", line 213: Error: objects that have been cast are
> not l-values
Ah well, the problem is we increment an enum which is Not The Right To Do.
> 2) Matthias re-worked my QDBM code and replaced the Relic API with the
> Depot API. First of all, this makes a few includes that are still
> present in the code superfluous, but second and worse, it's a lot
> slower as the Relic API does some optimization for you that you have
> to do by your own if you use the Depot API. I have added those
> things now. See attached patch for src/datastore_qdbm.c.
Why is the alignsize set to 16? We store 12-byte records at the moment,
and 16 are "dangerously" aligned to presumed CPU cache lines so we'd
better avoid it. 12 nicely skews the array mapping to CPU cache lines on
anything that has cache lines longer than 32 bit and should improve
cache efficiency without ever causing adverse effects.
I don't think we should stuff that re-organization code into
db_set_setvalue, or is the dpbnum so cheap we can afford it?
I'd think we'd better use db_close to reorganize. Objections?
Encrypt your mail: my GnuPG key ID is 0x052E7D95
More information about the Bogofilter-dev