
Neal Becker wrote:
I have 1 more question. What about an archive that uses mmap? This should be very efficient for saving/restoring large structures in binary format. Is this a good idea?
I did all the STL collections as I considered these "fundamental". . I did a version of shared_ptr myself as a test/proof of concept. 1 more question? Hmmm so for I have received submissions for serialization of optional, scoped_ptr, date_time library among othersThese are from people who needed to serialize other boost objects that they use. I've stopped incorporating them as the library is getting too big for me to manage. If this library is ever accepted, serialization of boost components will have to be a responsibility separate from the serialization library itself. After, they are really applications of the serialization library rathet than components of the library. So feel free, to make a serializer for any kind of data structure you find useful. All we have to do is to find a place to put it. Robert Ramey

Robert Ramey wrote:
Neal Becker wrote:
I have 1 more question. What about an archive that uses mmap? This should be very efficient for saving/restoring large structures in binary format. Is this a good idea?
I did all the STL collections as I considered these "fundamental". . I did a version of shared_ptr myself as a test/proof of concept.
1 more question? Hmmm so for I have received submissions for serialization of optional, scoped_ptr, date_time library among othersThese are from people who needed to serialize other boost objects that they use. I've stopped incorporating them as the library is getting too big for me to manage. If this library is ever accepted, serialization of boost components will have to be a responsibility separate from the serialization library itself. After, they are really applications of the serialization library rathet than components of the library.
So feel free, to make a serializer for any kind of data structure you find useful. All we have to do is to find a place to put it.
Thanks. Actually, though, what I'm talking about is a different archive type, not a data structure. Right now binary data is saved/restored using read/write. mmap is potentially much more efficient for large data structures. OTOH, there is one big problem for it, which is that mmap can only be applied to one contiguous memory region. I believe you would have to serialize one object to one file, and if you want more objects you would need multiple files to map them to. Still, might be interesting.

First off, I vote for bumping serialization to the top of the review queue. I've been using the library successfully in a development project for several months now. While I have not exercised the more advanced facets as some have, it works well with a complex mix of MFC, ATL, and boost libraries including bind, crc, function, iterators, signals and spirit. I've been able to serialize these to/from disk/clipboard/registry keys, etc. The only difficulty left (I haven't yet tried serialization17) is xml string output being rather verbose.
I have 1 more question. What about an archive that uses mmap? This should be very efficient for saving/restoring large structures in binary format. Is this a good idea?
This topic has come up on the spirit list. Originally I was a proponent of mmap approach based on experiencing major performance improvements with earlier version of Windows particularly Windows CE. Today I've seen much less difference in performance. I've been told that Windows 2K/Xp using NTFS memorymaps files under the covers, and unless your actively adressing into the memory range there's little to be gained, atleast on Windows. Perhaps other os do this as well?
I did all the STL collections as I considered these "fundamental". . I did a version of shared_ptr myself as a test/proof of concept.
1 more question? Hmmm so for I have received submissions for serialization of optional, scoped_ptr, date_time library among othersThese are from people who needed to serialize other boost objects that they use. I've stopped incorporating them as the library is getting too big for me to manage. If this library is ever accepted, serialization of boost components will have to be a responsibility separate from the serialization library itself. After, they are really applications of the serialization library rathet than components of the library.
Any thoughts on future serialization of boost::function even being possible? My use case is that I've a std::map of std::string/boost::function's that provide user configurable filters that detemine what gets displayed in a Table/List View. These currently are not being saved between sessions. It'd be great to do mFilterMap & ar; Robert, Thanks for the great job!!! Jeff

Jeff Flinn wrote: [...]
I have 1 more question. What about an archive that uses mmap? This should be very efficient for saving/restoring large structures in binary format. Is this a good idea?
This topic has come up on the spirit list. Originally I was a proponent of mmap approach based on experiencing major performance improvements with earlier version of Windows particularly Windows CE. Today I've seen much less difference in performance. I've been told that Windows 2K/Xp using NTFS memorymaps files under the covers, and unless your actively adressing into the memory range there's little to be gained, atleast on Windows. Perhaps other os do this as well?
I'm interested in linux myself. In restore, a big potential speed gain is possible if you don't actually use all the data. In that case it is never actually read from the disk. For save, I'm speculating that it is possible for the OS to optimize saving of unmodified pages using sparse files, but that maybe a bit farfetched.

"Jeff Flinn" <TriumphSprint2000@hotmail.com> wrote in message news:c22in1$god$1@sea.gmane.org...
This topic has come up on the spirit list. Originally I was a proponent of mmap approach based on experiencing major performance improvements with earlier version of Windows particularly Windows CE. Today I've seen much less difference in performance. I've been told that Windows 2K/Xp using NTFS memorymaps files under the covers, and unless your actively adressing into the memory range there's little to be gained, atleast on Windows. Perhaps other os do this as well?
This is an issue that I have researched before. I have compared the performance of Win32 memory mapped file API, synchronous file I/O API along with iostreams and C-style buffered I/O (stdio.h). Still have the benchmark prog but it uses a few library classes of my own so if I'd try to post enough of the source here so it can be built and run, it'll be rather unwieldy. It used fairly large I/O buffers (16K) to maximize throughput and tested both sequential and random reading and writing performance. Actually, I even had a provision to test file creation as opposed to writing to an already allocated space since it might have put mapped files at a disadvantage. The summary of multiple runs is on the attached chart. The chart is in logarithmic scale so actual numbers should be irrelevant. To provide a reference point, the test was run on a Xeon 1.7G x 2 machine with 2G RDRAM under Win.2003 Server and allocated the file on an NTFS-formatted 7200 RPM IDE drive connected to a non-RAID (and, as far as I can tell, non-cached) onboard IDE adapter. Typical run times for a 256M test file are 0.3-0.5 sec using memory mapped files, 0.5-0.6 sec using file I/O (I'm not even gonna mention iostreams and stdio here, you'll see how atrocious they are from the chart). Short version - memory mapped files are SO much faster, it is not even funny. I did not go the extra mile and test the asynchronous I/O (scatter/gather reads and writes); my expectation is that they should beat memory mapping but not by much. There apparently is a good reason to listen to the old Microsoft's recommendation and use memory mapping of files where possible. ...Max... begin 666 IOBenchmark.pdf M)5!$1BTQ+C(*)<#(S-(-"C$@,"!O8FH*/#P*+U1I=&QE("A)3T)E;F-H;6%R M:RYX;',I"B]!=71H;W(@*$UA>"D*+T-R96%T;W(@*'!D9D9A8W1O<GD@=W=W M+G!D9F9A8W1O<GDN8V]M*0HO4')O9'5C97(@*'!D9D9A8W1O<GD@,BXQ-2!< M*%=I;F1O=W,@,C P,R!397)V97(@4G5S<VEA;EPI*0HO0W)E871I;VY$871E M("A$.C(P,#0P,S R,3(U-S Q*0H^/@IE;F1O8FH*-" P(&]B:@H\/ HO1FEL M=&5R("]&;&%T941E8V]D90HO3&5N9W1H(#4@,"!2"CX^"G-T<F5A;0T*2(F% MEUW/W<:MA>_]*_9E6CBJYE,2$.2B:5.@0&Y:`[XVZK1Q82>M':-_OQR):TF; M(64<G),S7L^[-</A(CGSE.OC?X\M37U]Y'F9^N/#BR6W::ZZ?/_B[R]4SNM% ME,5%JGFJ%W%?7N16QG]._5A?@)ZGJ[XO+_(R3_6J'^LKL$SYJH_E15[+D[PO M3[ED65]^7M<7H):I7LZGZPO0UFF^_L*QO@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ET*/CX*96YD;V)J"C(@,"!O8FH*/#P*+U1Y<&4@+T-A M=&%L;V<*+U!A9V5S(#,@,"!2"B]6:65W97)0<F5F97)E;F-E<R Y(# @4@H^ M/@IE;F1O8FH*.2 P(&]B:@H\/ HO5'EP92 O5FEE=V5R4')E9F5R96YC97,* M/CX*96YD;V)J"GAR968*," Q, HP,# P,# P,# P(#8U-3,U(&8-"C P,# P M,# P,38@,# P,# @;@T*,# P,# P-3@W-2 P,# P,"!N#0HP,# P,# U.#$X M(# P,# P(&X-"C P,# P,# R,3 @,# P,# @;@T*,# P,# P-#0Q,B P,# P M,"!N#0HP,# P,# T-#,R(# P,# P(&X-"C P,# P,#0U-SD@,# P,# @;@T* M,# P,# P-38U," P,# P,"!N#0HP,# P,# U.30Y(# P,# P(&X-"G1R86EL M97(*/#P*+U-I>F4@,3 *+TEN9F\@,2 P(%(*+U)O;W0@,B P(%(*+TE$(%L\ M.3%&049!-$0P-T,X1C%%-C4V0S!".$$Q-T)!0C9&,3,^/#DQ1D%&031$,#=# M.$8Q138U-D,P0CA!,3="04(V1C$S/ET*/CX*<W1A<G1X<F5F"C4Y.34*)25% #3T8* ` end

I forgot to mention that benchmarking code randomly changed the order of tests to minimize the disparity in cache hit/miss ratios. Also, big difference in writing/creation times between memory-mapped and file-based I/O may mean that memory-mappings implement cached writes whereas file writes are somehow write-through, though it doesn't seem to be the case according to documentation. Perhaps CloseHandle() waits until all dirty cache pages are written to the device but does not wait for the dirty pages that belonged to the memory mapping. It is also possible that file-based writes and memory-mapped writes are logged differently in the NTFS journal. None of this should apply to reads, though. ...Max...

The summary of multiple runs is on the attached chart. The chart is in logarithmic scale so actual numbers should be irrelevant. To provide a reference point, the test was run on a Xeon 1.7G x 2 machine with 2G RDRAM under Win.2003 Server and allocated the file on an NTFS-formatted 7200 RPM IDE drive connected to a non-RAID (and, as far as I can tell, non-cached) onboard IDE adapter. Typical run times for a 256M test file are 0.3-0.5 sec using memory mapped files, 0.5-0.6 sec using file I/O (I'm not even gonna mention iostreams and stdio here, you'll see how atrocious they are from the chart).
Short version - memory mapped files are SO much faster, it is not even funny. I did not go the extra mile and test the asynchronous I/O (scatter/gather reads and writes); my expectation is that they should beat memory mapping but not by much. There apparently is a good reason to
At 02:17 PM 3/2/2004, Max Motovilov wrote: listen
to the old Microsoft's recommendation and use memory mapping of files where possible.
Hum... The chart only shows highly significant differences for "Create sequential, Win32 Map" and "Write sequential, Win32 Map" compared to the similar operations for other approaches. What was being measured? CPU time or wall clock time? But for those two operations the timing differences are so great that they make me wonder if the data was actually written to disk on those tests. Did you verify the data was actually written, and that your timing actually covered the period during which writing occurred? Remember that with some operating systems writing can under some conditions be deferred past the point where the program which creates the data terminates. Thus timings generated by the program itself can be bogus. Did you compute apparent disk-transfer rates to verify timings were reasonable? Just curious, --Beman

"Beman Dawes" <bdawes@acm.org> wrote in message
Hum... The chart only shows highly significant differences for "Create sequential, Win32 Map" and "Write sequential, Win32 Map" compared to the similar operations for other approaches.
Almost 2X for reading performance - it may not be immediately apparent because Y axis is logarithmic.
What was being measured? CPU time or wall clock time?
System time, which, I imagine, would be wall clock time in this parlance.
But for those two operations the timing differences are so great that they make me wonder if the data was actually written to disk on those tests.
I've theorized on that a bit in my follow-up message. Note that writing and reading performances are rather close for file mappings and far apart for regular file I/O. There's gotta be a write-through vs. write-back issue here somewhere.
Remember that with some operating systems writing can under some conditions be deferred past the point where the program which creates the data terminates. Thus timings generated by the program itself can be bogus.
I agree. However the data were collected over multiple runs of the same process as well as over multiple invocations of the test pass within one run. Neither guarantees measuring the final write-through performance of course, but IMHO this mode of testing approaches the natural behavior of an application running under this specific OS. After all, an application developer would probably be interested in observable performance numbers, even if optimizations built into the OS may result in indefinite delays before data actually end up on the disk.
Did you compute apparent disk-transfer rates to verify timings were reasonable?
Again, with the read-ahead and write-back behavior of the file cache, reasonability does not necessarily imply that you measure the low-level I/O operation. If this test really measures the overhead of different caching mechanisms within the OS it is fine by me, as long as it approximates what a real application would experience. Though I agree that running it on a system with less RAM and using larger files (I believe I did try 1G files and got very similar results but neglected to collect enough data with this setting) would give a different, no less interesting, insight. ...Max...

Robert, [snip]
to serialize these to/from disk/clipboard/registry keys, etc. The only difficulty left (I haven't yet tried serialization17) is xml string output being rather verbose.
FYI, This is no longer an issue with serialization17. std::strings are now output as expected. Jeff F

On Tue, 2 Mar 2004 08:28:25 -0800, Robert Ramey wrote
1 more question? Hmmm so for I have received submissions for serialization of optional, scoped_ptr, date_time library among others. These are from people who needed to serialize other boost objects that they use. I've stopped incorporating them as the library is getting too big for me to manage. If this library is ever accepted, serialization of boost components will have to be a responsibility separate from the serialization library itself. After, they are really applications of the serialization library rathet than components of the library.
I agree that the serialization for items like date-time should be part of date-time and not serialization. I was planning on working on the changes for date-time as part of my 'evaluation' of the new serialization. Jeff
participants (6)
-
Beman Dawes
-
Jeff Flinn
-
Jeff Garland
-
Max Motovilov
-
Neal D. Becker
-
Robert Ramey