|
Boost : |
From: Slava, Alex (raf.devel_at_[hidden])
Date: 2006-05-20 03:57:33
On 5/19/06, Xi Wang <xi.wang_at_[hidden]> wrote:
> Nice:-) I'd like to see more methods such as push_back, though resize
> could make it but not so convenient. And are there any plans for supporting
> insert/erase a record or a range of records?
>
resize routine is very expensive, thus it should be invoked as rare as posible.
push_back() makes resize each time called, so it is not effective.
insert/erase question: what to do with the tail of the file in this cases?
> Here are some more timings, FYI. All tests were performed on WinXP SP2
> with P4 3GHz HT, 1G memory, using test.cpp compiled by VC8 (cl /O2 /EHsc).
> Sequential tests read/write on a file sized 40M, while random tests were
> also
> limited to 1,000,000 iterations.
>
> Test type stub cstdio fstream randfile
> ----------------------------------------------
> Sequential read 0.03 6.87 23.76 0.05
> Sequential write 1.70 10.09 11.61 1.97
> Random read 0.03 4.31 9.58 0.05
> Random write 0.09 7.42 13.56 0.09
> Random read/write 0.14 6.95 13.34 0.14
>
> ps: cstdio and fstream implementations are those shipped with VC8.
Thank you very much for performance testing.
-- Svyatoslav Trukhanov, Oleksii Ursulenko
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk