From: Kristaps Dzonsons <kristaps@bsd.lv>
To: tech@mdocml.bsd.lv
Cc: Ingo Schwarze <schwarze@usta.de>
Subject: Re: sqlite3 mandocdb and apropos (etc.)
Date: Wed, 06 Jun 2012 00:43:00 +0200 [thread overview]
Message-ID: <4FCE8B74.10601@bsd.lv> (raw)
In-Reply-To: <20120605221704.GA27160@iris.usta.de>
On 06/06/2012 00:17, Ingo Schwarze wrote:
> Hi Kristaps,
>
> Kristaps Dzonsons wrote on Tue, Jun 05, 2012 at 04:32:17PM +0200:
>
>> Enclosed [finally] is a patch against HEAD that uses sqlite3 for
>> mandocdb and apropos (getting the others to use it is quite easy).
>> It's a work in progress, but is the simplest possible implementation
>> before extensive polishing. I'd like to get this in to start
>> refining.
>
> I am interested in the sqlite3 integration and hope we get it
> going. Certainly, this will need a thorough review, and i hope
> to find some time for it. As i couldn't find the time for a full
> review right now, i'm sending comments on one aspect that became
> obvious at once.
>
>> First of all, you'll need uthash (in ports) and sqlite3 to build. I
>> chose uthash for hashtables just because I'm familiar with it. I'd
>> like to use espie@'s ohash stuff instead to reduce dependencies, but
>> since uthash is just a header file, I'm not that concerned.
>
> First point, the base system cannot ever use anything from ports.
> Thus, using uthash would require to import it into base and maintain
> it there. So i had a brief look at it - and even without
> understanding what it does, i think there is no way in hell to ever
> get that imported. The file uthash.h alone is 900 lines of abusing
> cpp(1) macro definitions instead of defining proper functions. I
> cannot imagine that you will find anybody willing to do the required
> code audit on code of that style, let alone build consensus to import
> such code; myself, i must say it feels positively revolting on first
> sight.
>
> Of course, i might be wrong in my first impression, but if you
> suspect i am wrong and this is actually code of sufficient quality
> to be considered for inclusion in base, i'd recommend you first
> verify with some of the usual suspects for userland library hacking
> (like millert@, otto@, guenther@, deraadt@, ...) before spending
> a lot of time integrating it and then being disappointed later.
>
> Otherwise, it's probably better to choose tools available in base
> first and use those, at least for now, to avoid changing too much
> in a single step.
Ingo,
As mentioned, although important as a concept, this is a pretty
insignificant part of the code---I used uthash simply because it was
lightweight in terms of interfacing. It's not a final solution, nor is
it, as I've found, reasonable for optimistic growth---it didn't let me
control for allocation failure, which is a must for letting the string
table fill memory then purge when it overgrows.
So as said, I'll probably end up with espie@'s ohash, which from what I
understand uses Knuth's AofP algorithm and lets me control the hash
allocation.
Best,
Kristaps
--
To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv
prev parent reply other threads:[~2012-06-05 22:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-05 14:32 Kristaps Dzonsons
2012-06-05 22:17 ` Ingo Schwarze
2012-06-05 22:43 ` Kristaps Dzonsons [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FCE8B74.10601@bsd.lv \
--to=kristaps@bsd.lv \
--cc=schwarze@usta.de \
--cc=tech@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).