[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/
From: |
Nathaniel Smith |
Subject: |
Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch |
Date: |
Fri, 20 Jan 2006 20:03:28 -0800 |
User-agent: |
Mutt/1.5.9i |
On Fri, Jan 20, 2006 at 04:12:35PM +0100, Christof Petig wrote:
> I strongly feel that varargs is a bad choice for C++ programs, using
> your proposed % syntax is much cleaner (as with L() and boost::format).
He actually told me the same thing when I suggested going back to this
:-). Maybe I agree with you guys... but I should say why I suggested
it. The thing is that for an API like:
query("blah") % foo % bar % baz
I feel rather uncomfortable unless we copy the foo/bar/baz strings
into the query object; there's no convention in general that the
string data should stay in scope longer than the query object, so we
need to make a local copy. With arguments, there's more of a
convention that I can pass stuff by reference or by pointer and that
reference/pointer will stay alive until the call finishes.
Since we shovel hundreds of megabytes through this interface, reducing
copying seems worthwhile. I guess we do always copy now, though, so
actually I guess I have no data on whether the win is valuable or not.
We spend a lot of time in sqlite, but I don't know where exactly.
-- Nathaniel
--
"But suppose I am not willing to claim that. For in fact pianos
are heavy, and very few persons can carry a piano all by themselves."
This email may be read aloud.
- [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Vinzenz 'evilissimo' Feenstra, 2006/01/19
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Christof Petig, 2006/01/19
- Message not available
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Christof Petig, 2006/01/20
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch,
Nathaniel Smith <=
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Timothy Brownawell, 2006/01/21
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Richard Levitte - VMS Whacker, 2006/01/21
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Nathaniel Smith, 2006/01/22
- [Monotone-devel] Copy-on-write not mandated! (Was: Typesafe VA_ARGS replacement for database::execute/fetch), Clemens Hintze, 2006/01/22
- Re: [Monotone-devel] Copy-on-write not mandated! (Was: Typesafe VA_ARGS replacement for database::execute/fetch), Nathaniel Smith, 2006/01/22
- Re: [Monotone-devel] Copy-on-write not mandated! (Was: Typesafe VA_ARGS replacement for database::execute/fetch), Patrick Mauritz, 2006/01/23
- Re: [Monotone-devel] Copy-on-write not mandated!, Petr Ovtchenkov, 2006/01/24
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Vinzenz 'evilissimo' Feenstra, 2006/01/21
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Vinzenz 'evilissimo' Feenstra, 2006/01/21
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Vinzenz 'evilissimo' Feenstra, 2006/01/21