|
Boost Users : |
Subject: Re: [Boost-users] Fastest way of serializing a huge vector of ints into a human readable string
From: Roland Bock (rbock_at_[hidden])
Date: 2009-03-01 13:47:12
Ovanes,
ok, got it! Thanks for the nice examples and your patience. I learned a
lot today :-)
In the meantime I created my own FormattedBackInserter (see attached
code, just a very crude prototype as of now), which allows me to do the
job even faster via std::copy.
Regards,
Roland
Ovanes Markarian wrote:
>
>
> On Sun, Mar 1, 2009 at 3:36 PM, Roland Bock <rbock_at_[hidden]
> <mailto:rbock_at_[hidden]>> wrote:
>
> Ovanes,
>
> I wonder, though, is there a standard way to write integers to a
> stream_buf? As far as I can see, the ostreambuf_iterator takes
> character classes as template arguments, only.
>
> Regards,
>
> Roland
>
>
>
> Roland,
>
> please take a look at this code:
> http://codepad.org/UGubU7cw
>
> It it always customized numeric converter is almost always faster as
> writing integers to stringstream with operator<<.
> Anyway these two tests perform most equally on linux/g++ (but tested
> very roughly). For Example on MSVC-compiler std::copy was faster as the
> for-loop. I assume compiler can better optimze in this case.
>
>
> Good Luck,
> Ovanes
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net