Streams 0.2.1 beta released
Bulat Ziganshin
bulat.ziganshin at gmail.com
Wed Jul 12 07:07:41 EDT 2006
Hello libraries,
I've updated http://www.haskell.org/library/StreamsBeta.tar.gz
with the following:
* fixed problem with Unix compilation
* fixed bug with writing after vSeek
* added support for memory-mapped files on Unix
* added support for files >4GB on Windows
* added/improved test programs MMFile.hs, wcMMFile.hs, FD5gb.hs, DeriveBinary.hs
Look at http://article.gmane.org/gmane.comp.lang.haskell.libraries/4820
for installation/usage instructions
Using memory-mapped files provides slight speed improvement because it
excludes the need to move data between OS buffer and application buffer.
Moreover, this may scale better in multi-threading environments without
need to implement special async I/O, although i don't checked this
assumption.
I thanks Adam Langley who's provided initial mmaped files
implementation and tested all the changes. Moreover, he tested the lib
on 1.66Ghz Intel Core Duo box and got the results stating that
Strings I/O speed is at range of 30-100 mb/sec, while with
Chars/ByteStrings/buffers I/O speed is at range of 100-400 mb/sec.
It's the full test results. Each line shows the time of reading or
writing 100 mb of data using various Stream types, I/O routines and
line/buffer sizes (20 or 80 bytes):
Unchecked MemBuf:
vPutBuf: 0.093 secs (user: 0.090 secs)
vGetBuf: 0.035 secs (user: 0.030 secs)
vPutChar: 0.708 secs (user: 0.700 secs)
vGetChar: 0.346 secs (user: 0.340 secs)
vPutBuf20: 0.191 secs (user: 0.190 secs)
vGetBuf20: 0.191 secs (user: 0.190 secs)
vPutByteStrLn20: 0.448 secs (user: 0.450 secs)
vGetByteLine20 : 0.632 secs (user: 0.630 secs)
vPutStrLn20: 1.229 secs (user: 1.230 secs)
vGetLine20 : 1.387 secs (user: 1.380 secs)
vGetByteLines20: 0.725 secs (user: 0.720 secs)
vPutByteStrLn80: 0.139 secs (user: 0.130 secs)
vGetByteLine80 : 0.253 secs (user: 0.250 secs)
vPutStrLn80: 1.066 secs (user: 1.070 secs)
vGetLine80 : 1.251 secs (user: 1.250 secs)
vGetByteLines80: 0.273 secs (user: 0.270 secs)
vGetContents: 2.767 secs (user: 2.770 secs)
MemBuf:
vPutBuf: 0.094 secs (user: 0.090 secs)
vGetBuf: 0.036 secs (user: 0.030 secs)
vPutChar: 0.567 secs (user: 0.560 secs)
vGetChar: 0.406 secs (user: 0.410 secs)
vPutBuf20: 0.221 secs (user: 0.220 secs)
vGetBuf20: 0.227 secs (user: 0.230 secs)
vPutByteStrLn20: 0.460 secs (user: 0.460 secs)
vGetByteLine20 : 0.667 secs (user: 0.670 secs)
vPutStrLn20: 1.249 secs (user: 1.250 secs)
vGetLine20 : 1.589 secs (user: 1.590 secs)
vGetByteLines20: 0.759 secs (user: 0.750 secs)
vPutByteStrLn80: 0.142 secs (user: 0.150 secs)
vGetByteLine80 : 0.253 secs (user: 0.260 secs)
vPutStrLn80: 1.066 secs (user: 1.070 secs)
vGetLine80 : 1.348 secs (user: 1.350 secs)
vGetByteLines80: 0.284 secs (user: 0.280 secs)
vGetContents: 2.841 secs (user: 2.840 secs)
FD:
vPutBuf: 0.338 secs (user: 0.250 secs)
vGetBuf: 0.091 secs (user: 0.100 secs)
vPutChar: 0.680 secs (user: 0.680 secs)
vGetChar: 0.499 secs (user: 0.500 secs)
vPutBuf20: 0.354 secs (user: 0.340 secs)
vGetBuf20: 0.317 secs (user: 0.310 secs)
vPutByteStrLn20: 3.482 secs (user: 0.560 secs)
vGetByteLine20 : 0.788 secs (user: 0.790 secs)
vPutStrLn20: 1.360 secs (user: 1.340 secs)
vGetLine20 : 1.677 secs (user: 1.670 secs)
vGetByteLines20: 0.866 secs (user: 0.860 secs)
vPutByteStrLn80: 0.251 secs (user: 0.250 secs)
vGetByteLine80 : 0.347 secs (user: 0.350 secs)
vPutStrLn80: 1.176 secs (user: 1.180 secs)
vGetLine80 : 1.435 secs (user: 1.440 secs)
vGetByteLines80: 0.374 secs (user: 0.370 secs)
vGetContents: 2.939 secs (user: 2.940 secs)
FD utf8:
vPutBuf: 0.118 secs (user: 0.100 secs)
vGetBuf: 0.087 secs (user: 0.090 secs)
vPutChar: 3.931 secs (user: 3.930 secs)
vGetChar: 3.282 secs (user: 3.280 secs)
vPutBuf20: 0.330 secs (user: 0.330 secs)
vGetBuf20: 0.308 secs (user: 0.300 secs)
vPutByteStrLn20: 0.564 secs (user: 0.560 secs)
vGetByteLine20 : 0.771 secs (user: 0.770 secs)
vPutStrLn20: 6.104 secs (user: 3.950 secs)
vGetLine20 : 4.285 secs (user: 4.280 secs)
vGetByteLines20: 0.861 secs (user: 0.860 secs)
vPutByteStrLn80: 0.255 secs (user: 0.250 secs)
vGetByteLine80 : 0.351 secs (user: 0.360 secs)
vPutStrLn80: 3.700 secs (user: 3.690 secs)
vGetLine80 : 4.037 secs (user: 4.040 secs)
vGetByteLines80: 0.373 secs (user: 0.370 secs)
vGetContents: 5.337 secs (user: 5.340 secs)
FD locked:
vPutBuf: 0.114 secs (user: 0.110 secs)
vGetBuf: 0.087 secs (user: 0.080 secs)
vPutChar: 8.292 secs (user: 8.300 secs)
vGetChar: 8.626 secs (user: 8.630 secs)
vPutBuf20: 0.545 secs (user: 0.550 secs)
vGetBuf20: 0.519 secs (user: 0.520 secs)
vPutByteStrLn20: 0.877 secs (user: 0.870 secs)
vGetByteLine20 : 1.022 secs (user: 1.020 secs)
vPutStrLn20: 3.127 secs (user: 1.540 secs)
vGetLine20 : 1.945 secs (user: 1.940 secs)
vGetByteLines20: 0.868 secs (user: 0.870 secs)
vPutByteStrLn80: 0.333 secs (user: 0.300 secs)
vGetByteLine80 : 0.398 secs (user: 0.400 secs)
vPutStrLn80: 1.201 secs (user: 1.200 secs)
vGetLine80 : 1.490 secs (user: 1.490 secs)
vGetByteLines80: 0.379 secs (user: 0.370 secs)
vGetContents: 2.940 secs (user: 2.940 secs)
Handle:
vPutBuf: 0.117 secs (user: 0.120 secs)
vGetBuf: 0.107 secs (user: 0.110 secs)
vPutChar: 32.172 secs (user: 32.170 secs)
vGetChar: 19.427 secs (user: 19.420 secs)
vPutBuf20: 1.283 secs (user: 1.280 secs)
vGetBuf20: 1.236 secs (user: 1.240 secs)
vPutByteStrLn20: 3.283 secs (user: 1.900 secs)
vGetByteLine20 : 1.867 secs (user: 1.860 secs)
vPutStrLn20: 6.252 secs (user: 5.580 secs)
vGetLine20 : 2.501 secs (user: 2.500 secs)
vGetByteLines20: 2.064 secs (user: 2.060 secs)
vPutByteStrLn80: 0.598 secs (user: 0.600 secs)
vGetByteLine80 : 0.950 secs (user: 0.950 secs)
vPutStrLn80: 2.348 secs (user: 2.350 secs)
vGetLine80 : 1.741 secs (user: 1.740 secs)
vGetByteLines80: 0.995 secs (user: 0.990 secs)
vGetContents: 12.351 secs (user: 12.350 secs)
Handle buffered:
vPutBuf: 0.117 secs (user: 0.110 secs)
vGetBuf: 0.087 secs (user: 0.090 secs)
vPutChar: 0.668 secs (user: 0.670 secs)
vGetChar: 0.488 secs (user: 0.490 secs)
vPutBuf20: 0.330 secs (user: 0.330 secs)
vGetBuf20: 0.308 secs (user: 0.300 secs)
vPutByteStrLn20: 0.561 secs (user: 0.560 secs)
vGetByteLine20 : 0.772 secs (user: 0.780 secs)
vPutStrLn20: 3.982 secs (user: 1.370 secs)
vGetLine20 : 1.722 secs (user: 1.720 secs)
vGetByteLines20: 0.863 secs (user: 0.860 secs)
vPutByteStrLn80: 0.255 secs (user: 0.260 secs)
vGetByteLine80 : 0.352 secs (user: 0.350 secs)
vPutStrLn80: 1.177 secs (user: 1.180 secs)
vGetLine80 : 1.502 secs (user: 1.500 secs)
vGetByteLines80: 0.378 secs (user: 0.380 secs)
vGetContents: 2.929 secs (user: 2.910 secs)
Handle buffered+locked:
vPutBuf: 0.116 secs (user: 0.110 secs)
vGetBuf: 0.087 secs (user: 0.090 secs)
vPutChar: 8.393 secs (user: 8.390 secs)
vGetChar: 8.118 secs (user: 8.120 secs)
vPutBuf20: 0.552 secs (user: 0.550 secs)
vGetBuf20: 0.519 secs (user: 0.520 secs)
vPutByteStrLn20: 0.782 secs (user: 0.780 secs)
vGetByteLine20 : 0.975 secs (user: 0.980 secs)
vPutStrLn20: 3.392 secs (user: 1.600 secs)
vGetLine20 : 1.933 secs (user: 1.920 secs)
vGetByteLines20: 0.875 secs (user: 0.870 secs)
vPutByteStrLn80: 0.328 secs (user: 0.310 secs)
vGetByteLine80 : 0.401 secs (user: 0.400 secs)
vPutStrLn80: 1.204 secs (user: 1.210 secs)
vGetLine80 : 1.546 secs (user: 1.530 secs)
vGetByteLines80: 0.379 secs (user: 0.380 secs)
vGetContents: 2.911 secs (user: 2.910 secs)
MMFile:
vPutBuf: 0.108 secs (user: 0.110 secs)
vGetBuf: 0.107 secs (user: 0.100 secs)
vPutChar: 0.592 secs (user: 0.590 secs)
vGetChar: 0.427 secs (user: 0.430 secs)
vPutBuf20: 0.247 secs (user: 0.250 secs)
vGetBuf20: 0.248 secs (user: 0.250 secs)
vPutByteStrLn20: 0.496 secs (user: 0.500 secs)
vGetByteLine20 : 0.687 secs (user: 0.690 secs)
vPutStrLn20: 1.282 secs (user: 1.280 secs)
vGetLine20 : 1.578 secs (user: 1.570 secs)
vGetByteLines20: 0.785 secs (user: 0.790 secs)
vPutByteStrLn80: 0.170 secs (user: 0.170 secs)
vGetByteLine80 : 0.279 secs (user: 0.280 secs)
vPutStrLn80: 1.097 secs (user: 1.090 secs)
vGetLine80 : 1.351 secs (user: 1.350 secs)
vGetByteLines80: 0.310 secs (user: 0.310 secs)
vGetContents: 2.843 secs (user: 2.840 secs)
--
Best regards,
Bulat mailto:Bulat.Ziganshin at gmail.com
More information about the Libraries
mailing list