Re: [Quickfix-developers] How to set custom/user-defined fields
Brought to you by:
orenmnero
From: Caleb E. <ca...@bk...> - 2004-05-17 17:44:26
|
On Mon, May 17, 2004 at 10:26:08AM -0500, Oren Miller wrote: > Nope, that should be passed as a reference. I made the change and > did a performance test and it actually doesn't make any difference, at > least when using an optimizer. My guess is the optimizer is smart > enough to know that if you are passing in a const object, it might as > well pass it in as a reference anyway. With the optimizer turned off > it there would be a significant difference. In any case I'll check in > the change. It depends where you do your testing I wager. With gcc, std::string is reference counted, so leaving off the & should be more or less harmless. On other platforms, though, std::string has copy semantics and this may help speed things up. Nto sure if you care about "ABI" compatibility, but this interface change will cause your new quickfix lib to be runtime-incompatible with older versions (since it will no longere provde the the setField method that takes a plain string). You may want to provide *both* forms or bump at least the .so version number. Small change but potentially large impact. -- Caleb Epstein | bklyn . org | T-shirt: cae at | Brooklyn Dust | Life is *not* a Cabaret, and stop bklyn dot org | Bunny Mfg. | calling me chum! |