gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
mnabil has quit [Ping timeout: 255 seconds]
alexyk has joined #ocaml
onigiri_ has joined #ocaml
onigiri_ has left #ocaml []
mnabil has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
agarwal1975 has quit [Quit: agarwal1975]
mfp has quit [Ping timeout: 264 seconds]
mfp has joined #ocaml
alexyk has joined #ocaml
onigiri_ has joined #ocaml
onigiri_ has left #ocaml []
boscop has quit [Ping timeout: 240 seconds]
sepp2k has quit [Quit: Leaving.]
alexyk has quit [Read error: Connection reset by peer]
arubin has joined #ocaml
alexyk has joined #ocaml
tony_ has left #ocaml []
mnabil has quit [Ping timeout: 276 seconds]
alexyk has quit [Quit: alexyk]
mnabil has joined #ocaml
iris1 has quit [Quit: iris1]
lopex has quit []
eaburns has left #ocaml []
CoryDambach has joined #ocaml
cthuluh has quit [Ping timeout: 260 seconds]
cthuluh has joined #ocaml
philtor has joined #ocaml
mnabil has quit [Ping timeout: 276 seconds]
kaustuv has left #ocaml []
mnabil has joined #ocaml
<philtor> I've got ocaml 3.11 that comes with Ubuntu 10.10. And I've also got OCaml 3.12 installed via godi. So I
<philtor> So i've set up the path to point to the 3.12 one from godi.
<philtor> which ocaml -> /home/phil/godi-3.12/bin/ocaml
<philtor> However... when I try to build type-conv and install it...
<philtor> It tries to install in /usr/local/ocaml/lib
<philtor> What is that?
<philtor> s/What/Why/
bzzbzz has quit [Read error: Connection reset by peer]
bzzbzz has joined #ocaml
Associat0r has joined #ocaml
shachaf has quit [*.net *.split]
BiDOrD has quit [*.net *.split]
jlenormand has quit [*.net *.split]
kig has quit [*.net *.split]
diml has quit [*.net *.split]
hcarty has quit [*.net *.split]
chicco has quit [*.net *.split]
<thelema> philtor: that's where findlib is configured to install?
<philtor> How does one change that configuration?
<philtor> What I found was that if I run this from the commandline it works: ocamlfind install type-conv META pa_type_conv.cmi pa_type_conv.cmo
<philtor> That's what the makefile is generating - but the ocamlfind being run in the makefile is the old ocamlfind.
<philtor> From the OCamlMakefile included:
<philtor> ifndef OCAMLFIND
<philtor> OCAMLFIND := ocamlfind
<philtor> endif
<philtor> that seems to be the 3.11 ocamlfind.
<philtor> but only inside of the makfile...
<philtor> From the commandline: which ocamlfind
<philtor> /home/phil/godi-3.12/bin/ocamlfind
<philtor> (which is the correct one)
Amorphous has quit [Ping timeout: 272 seconds]
<thelema> philtor: ocamlfind uses some environment variable to decide where to install
<thelema> iirc
<thelema> and there's an ocamlfind.conf file somewhere
<thelema> OCAMLPATH is the environment variable
<philtor> Hmm... I don't have an OCAMLPATH env variable set.
<thelema> maybe it defaults to ocamlc -where
<philtor> That points to the 3.12 installation in my case (the correct one)
arubin has quit [Quit: arubin]
<philtor> Not finding an ocamlfind.conf anywhere.
Amorphous has joined #ocaml
shachaf has joined #ocaml
BiDOrD has joined #ocaml
jlenormand has joined #ocaml
kig has joined #ocaml
diml has joined #ocaml
hcarty has joined #ocaml
chicco has joined #ocaml
Associat0r has quit [Quit: Associat0r]
philtor has quit [Remote host closed the connection]
philtor has joined #ocaml
<philtor> Ah, there is an ocamlfind.conf in /etc
<philtor> What's the difference between ocamlfind.conf and findlib.conf? Are they the same thing?
ulfdoz has joined #ocaml
Yoric has joined #ocaml
avsm has quit [Ping timeout: 240 seconds]
avsm has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
philtor has quit [Ping timeout: 265 seconds]
ulfdoz has quit [Ping timeout: 245 seconds]
Snark has joined #ocaml
Yoric has quit [Quit: Yoric]
edwin has joined #ocaml
ttamttam has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
Yoric has joined #ocaml
ikaros has joined #ocaml
avsm has quit [Quit: Leaving.]
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
munga has joined #ocaml
mnabil has quit [Ping timeout: 276 seconds]
mnabil has joined #ocaml
_andre has joined #ocaml
eaburns has joined #ocaml
munga has quit [Ping timeout: 240 seconds]
mnabil has quit [Ping timeout: 241 seconds]
lopex has joined #ocaml
mnabil has joined #ocaml
tony_ has joined #ocaml
ttamttam has quit [Remote host closed the connection]
boscop has joined #ocaml
tony_ has quit [Ping timeout: 246 seconds]
oriba has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
sepp2k has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
mnabil has quit [Ping timeout: 250 seconds]
mnabil has joined #ocaml
mnabil has quit [Ping timeout: 276 seconds]
<thelema> Is anyone involved in ongoing discussions on COCAN?
myu2 has quit [Remote host closed the connection]
<thelema> oops, year. Feb 2010 != yesterday
<thelema> COCAN seems to have quietly passed
eye-scuzzy has quit [*.net *.split]
shachaf has quit [*.net *.split]
BiDOrD has quit [*.net *.split]
jlenormand has quit [*.net *.split]
kig has quit [*.net *.split]
diml has quit [*.net *.split]
hcarty has quit [*.net *.split]
chicco has quit [*.net *.split]
mlh has quit [*.net *.split]
lopex has quit [*.net *.split]
f[x] has quit [*.net *.split]
Julien_T has quit [*.net *.split]
kerneis has quit [*.net *.split]
xl0 has quit [*.net *.split]
lamawithonel has quit [*.net *.split]
ski has quit [*.net *.split]
sepp2k has quit [*.net *.split]
Yoric has quit [*.net *.split]
mfp has quit [*.net *.split]
srcerer has quit [*.net *.split]
trigen has quit [*.net *.split]
avsm2 has quit [*.net *.split]
pantsd has quit [*.net *.split]
ikaros has quit [*.net *.split]
eaburns has quit [*.net *.split]
hto has quit [*.net *.split]
orbitz has quit [*.net *.split]
mrvn has quit [*.net *.split]
alpounet has quit [*.net *.split]
vk0 has quit [*.net *.split]
pheredhel has quit [*.net *.split]
deavid has quit [*.net *.split]
bitbckt has quit [*.net *.split]
_2x2l has quit [*.net *.split]
metasyntax` has quit [*.net *.split]
thelema has quit [*.net *.split]
hyperboreean has quit [*.net *.split]
Snark has quit [*.net *.split]
Amorphous has quit [*.net *.split]
cthuluh has quit [*.net *.split]
npouillard has quit [*.net *.split]
mcclurmc has quit [*.net *.split]
patronus_ has quit [*.net *.split]
svenl_ has quit [*.net *.split]
mehdid has quit [*.net *.split]
rossberg has quit [*.net *.split]
noj has quit [*.net *.split]
mnabil has joined #ocaml
deavid has joined #ocaml
joewilliams is now known as joewilliams_away
eaburns has joined #ocaml
alpounet has joined #ocaml
orbitz has joined #ocaml
hto has joined #ocaml
orbitz has quit [Client Quit]
orbitz has joined #ocaml
joewilliams_away is now known as joewilliams
thelema_ has joined #ocaml
lopex has joined #ocaml
vk0_ has joined #ocaml
ikaros has joined #ocaml
mrvn has joined #ocaml
pheredhel has joined #ocaml
_2x2l has joined #ocaml
bitbckt has joined #ocaml
sepp2k has joined #ocaml
eye-scuzzy has joined #ocaml
Yoric has joined #ocaml
Snark has joined #ocaml
chicco has joined #ocaml
hcarty has joined #ocaml
diml has joined #ocaml
kig has joined #ocaml
jlenormand has joined #ocaml
BiDOrD has joined #ocaml
shachaf has joined #ocaml
Amorphous has joined #ocaml
cthuluh has joined #ocaml
mfp has joined #ocaml
srcerer has joined #ocaml
metasyntax` has joined #ocaml
thelema has joined #ocaml
lamawithonel has joined #ocaml
trigen has joined #ocaml
mlh has joined #ocaml
npouillard has joined #ocaml
hyperboreean has joined #ocaml
ski has joined #ocaml
f[x] has joined #ocaml
avsm2 has joined #ocaml
mcclurmc has joined #ocaml
pantsd has joined #ocaml
Julien_T has joined #ocaml
kerneis has joined #ocaml
xl0 has joined #ocaml
patronus_ has joined #ocaml
svenl_ has joined #ocaml
mehdid has joined #ocaml
rossberg has joined #ocaml
noj has joined #ocaml
eaburns is now known as Guest96760
BiDOrD has quit [Read error: Operation timed out]
BiDOrD has joined #ocaml
srcerer has quit [Ping timeout: 262 seconds]
BiDOrD_ has joined #ocaml
BiDOrD has quit [Read error: Operation timed out]
Snark has quit [*.net *.split]
Amorphous has quit [*.net *.split]
cthuluh has quit [*.net *.split]
npouillard has quit [*.net *.split]
mcclurmc has quit [*.net *.split]
patronus_ has quit [*.net *.split]
svenl_ has quit [*.net *.split]
mehdid has quit [*.net *.split]
rossberg has quit [*.net *.split]
noj has quit [*.net *.split]
hyperbor1ean has joined #ocaml
Snark has joined #ocaml
Amorphous has joined #ocaml
cthuluh has joined #ocaml
npouillard has joined #ocaml
mcclurmc has joined #ocaml
patronus_ has joined #ocaml
svenl_ has joined #ocaml
mehdid has joined #ocaml
rossberg has joined #ocaml
noj has joined #ocaml
Guest96760 has quit [Quit: leaving]
hyperboreean has quit [Write error: Connection reset by peer]
thelema has quit [Write error: Broken pipe]
ccasin has joined #ocaml
<gildor> thelema_: what the pb with COCAN ?
<thelema_> gildor: Firefox can't establish a connection to the server at www.cocan.org.
<gildor> thelema_: it is dead since at least 2 months
<gildor> I have an old copy on mirror.ocamlcore.org
<gildor> and Ashish Agarwal is working on transfering part of its content
<thelema_> ok, thanks
thelema_ is now known as thelema
<thelema> wow, another extlib... I'd never heard of the CDK before
myu2 has joined #ocaml
<gildor> thelema: where did you hear about the CDK?
eye-scuzzy has quit [Quit: leaving]
<thelema> gildor: There was a link here: http://mirror.ocamlcore.org/wiki.cocan.org/humpopaedia.html
<gildor> the CDK has 3 release and lasted ~1 year
<gildor> +s
eye-scuzzy has joined #ocaml
<gildor> and 80% consist of copy of other project (like lablgtk or part of ocamlnet)
<gildor> +s
<thelema> yup, so it seems.
<gildor> there was probably 20% which was original code
<f[x]> it is more like batteries than extlib
<f[x]> pack of useful libraries
<gildor> and its main author (F. Le Fessant) has forked it many time in various application
<thelema> f[x]: there's an extlib within CDK
<f[x]> gildor, yeah, e.g. mldonkey
<gildor> mnplight also
<gildor> I think there is one fork per project
<gildor> with different extension
<f[x]> as usual with bundled libs
<thelema> Maybe I can absorb any good parts of that 20% into batteries...
<gildor> beware the license
<thelema> gildor: not LGPL+exception? :(
<gildor> range from Public Domain to GPL
<gildor> (and for god sake, don't include bundled libraries that continue to live elsewhere)
<thelema> looks like the bits I'm interested in are GPL. maybe I can get a different License
<thelema> gildor: would you consider this code as living?
<gildor> e.g. camlimages, camlzip, configwin, cryptgps, facile, labgl, lablgtk
<thelema> of course, I won't repeat that mistake.
<gildor> thelema: if it is just the code, in extlib, just go on
<thelema> wow, specialized code for float arrays...
<thelema> It looks like I need to make a benchmark for reading files - I can't figure out why I keep seeing [filename -> string] code that uses a resizing buffer to store chunks of data
<thelema> plus, what's the optimal buffer size for ext3? Wouldn't it be 4K?
mnabil has quit [Read error: Operation timed out]
<gildor> I don't think buffer size is a big issue
<gildor> thelema: ^^^
<thelema> There's only one way to tell
<gildor> thelema: I have tried with various buffer size (direct file access) and didn't get a really improved throughput
<thelema> using Science!
<thelema> true, it's probably not a huge deal, as the CPU load is much smaller than the drive access time
<gildor> and 4k buffer can give you almost 130MB/s on a RAID array
<thelema> sure. but I keep seeing 1K buffers
<thelema> and bitstring uses 16K buffers
<gildor> give us you benchmark results when you are done
<thelema> of course
<thelema> once I finish my more urgent task for the day
<thelema> btw, wikipedia says that our new hotness PRNG has very poor behavior: http://en.wikipedia.org/wiki/Lagged_Fibonacci_generator
lopex has quit []
<gildor> thelema: the default PRNG is only there for convenience, cryptokit is here to provide better PRNG
<gildor> (system prng in fact)
<thelema> true
philtor has joined #ocaml
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 255 seconds]
mnabil has joined #ocaml
ankit9 has joined #ocaml
trch has joined #ocaml
<thelema> gildor: except why upgrade it if it's not supposed to be a good PRNG?
<thelema> why break compatibility with older programs
<gildor> thelema: not sure to understand, what do you want to upgrade
<thelema> all users of random are forced to upgrade to the new PRNG
<gildor> ah, you mean that 3.12 has a new prng!
<thelema> yes
<gildor> (I already spotted that in fact)
<thelema> :)
<gildor> I have the code of the old PRNG sitting in a project (ocaml-fastrandom)
<gildor> maybe it is time to release it
<gildor> "fast"random because it is ~3 time faster than the old PRNG
jonafan has joined #ocaml
lopex has joined #ocaml
arubin has joined #ocaml
arubin has quit [Remote host closed the connection]
<thelema> it seems that a 2k buffer is best, closely followed by a 4k buffer
<thelema> tested on a 183MB file
<thelema> a file that is almost certainly cached in linux's filesystem buffers by now
<mrvn> thelema: 4k should be optimal usualy because that is the granularity file operations work at in the kernel. Must be some cache issue.
<thelema> that was my reasoning
<thelema> I'm surprised that the cost of blitting the data from a string to a buffer isn't more
Yoric has quit [Quit: Yoric]
eye-scuzzy has quit [Quit: leaving]
<mrvn> can you add bigarray mmap?
<thelema> just loop to copy from the mmap to a string?
<mrvn> thelema: that would skew the result.
<thelema> just map_file?
<mrvn> I guess you would need to add some access to the read data to all tests for mmap to be fair.
<mrvn> Without access mmap wouldn't read anything.
<thelema> yup, it'd be almost a noop
<mrvn> But you could read into a normal bigarray. The Unix.read copies each chunk it reads.
<thelema> pastebin the function and I'll add it in
<thelema> :P
<mrvn> Non threaded, lacking the enter/leave_blocking_mode() around the pread.
<thelema> no threads in my test
<mrvn> I assumed
<thelema> #includes?
<thelema> well, it turns out that a lot of time *is* saved by checking the size of the file and reading exactly that much. what a surprise. http://pastebin.com/T6NG3ncn
<thelema> mrvn: and what type is` buffer`?
joewilliams is now known as joewilliams_away
bitbckt_ has joined #ocaml
mnabil_ has joined #ocaml
eye-scuzzy has joined #ocaml
<mrvn> I should polish the bigarray io functions for inclusion in batteries
sepp2k1 has quit [Ping timeout: 255 seconds]
_2x2l has quit [Ping timeout: 255 seconds]
mnabil has quit [Ping timeout: 265 seconds]
bitbckt has quit [Ping timeout: 265 seconds]
_2x2l has joined #ocaml
<thelema> mrvn: sounds good to me
<mrvn> thelema: Bigarray. any kind should do. I use uint8 with c layout.
joewilliams_away is now known as joewilliams
<thelema> ok
<mrvn> http://pastebin.com/1U1vZyEJ are the includes but you don't need all of them.
<mrvn> _XOPEN_SOURCE and unistd.h for pread, caml/bigarray.h for bigarray stufff. mlvalues.h I think you need too
<thelema> it shouldn't hurt to over-include
<mrvn> yeah, just comment out lines till it gives an error.
trch has left #ocaml []
<mrvn> thelema: one thing that might also be interesting would be to create threads and do multiple reads in parallel.
<thelema> I think someone already did those benchmarks in C
<mrvn> for sure
sepp2k has joined #ocaml
<mrvn> thelema: somehow I find optimizing jobs that run under 10s pointless.
mnabil_ has quit [Remote host closed the connection]
ftrvxmtrx has quit [Quit: Leaving]
myu2 has quit [Remote host closed the connection]
ymasory has joined #ocaml
myu2 has joined #ocaml
<thelema> http://pastebin.com/AvP01xA0 <- mmap is too fast to measure, Unix fds are slower than Pervasives in_channels
<thelema> and buffer size does matter
arubin has joined #ocaml
_2x2l has quit [Ping timeout: 255 seconds]
joewilliams is now known as joewilliams_away
_2x2l has joined #ocaml
joewilliams_away is now known as joewilliams
ulfdoz has joined #ocaml
bitbckt_ is now known as bitbckt
bitbckt has quit [Changing host]
bitbckt has joined #ocaml
tony_ has joined #ocaml
ymasory has quit [Remote host closed the connection]
<mrvn> How can Unix.fd be slower? That is the most basic thing you can use.
<thelema> here's the whole testfile: http://pastebin.com/VtD2qEsy
jlenormand has quit [Quit: Leaving]
<thelema> compile with ocamlfind ocamlopt -linkpkg -thread -package batteries,threads,benchmark,bitstring t_read.ml -o t_read
_andre has quit [Quit: Zzz]
<mrvn> thelema: I'm not disputing your results. Just wondering how that can be.
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
Snark has quit [Quit: Ex-Chat]
<thelema> any jane-street core users here? Is there a helper function in that library to read a file into a string?
<gildor> thelema: this is in the module bigstring, i think (and it uses bigarray and mmap)
<bitbckt> Common.read_lines
<bitbckt> string -> string list, anyhow.
<thelema> bitbckt: almost. I'm tempted to add filename -> BatRope.t to see how much the buffer costs
<bitbckt> thelema: That's as close as it gets in Core, I think.
<gildor> thelema: what is vbu ?
<thelema> gildor: thanks
<gildor> thelema: Bigstring.map_file seems nice
<thelema> variable-sized buffer unix
<gildor> thelema: everything use channel ?
<thelema> gildor: doesn't actually read the file into memory - I guess I could String.iter each string to force it into memory
<thelema> gildor: vbu uses Unix.fd, vbp uses pervasives.in_channel
<thelema> gildor: batio uses batteries' channel + read_all
<gildor> 183MB ?
<thelema> yes, the size of the test file
<gildor> humm
<gildor> the test is short, that what worry me
<thelema> because it only runs for a few seconds?
<gildor> can you send me your code
<thelema> I have larger files I can run it on
<thelema> 13:48 < thelema> here's the whole testfile: http://pastebin.com/VtD2qEsy
<gildor> you should use a file bigger than the memory
<gildor> i.e. ~2 to 4 GB
<thelema> eep! wouldn't that measure how fast my system can swap?
<brendan> it'd measure gc and disk throughput. Better to use something that fits in cache
<gildor> you keep the data in memory after the read ?
<thelema> I'm reading the whole file into memory, having linux put that memory back into the swap seems silly
<thelema> yes, I'm testing [filename -> string] functions
ikaros has quit [Read error: Connection timed out]
<thelema> mrvn: your pread completes almost as fast as mmap
<gildor> ah yes, so indeed you will stress Gc and swap
<gildor> my use case was more io -> process -> io
<gildor> with a few data in memory
ikaros has joined #ocaml
<thelema> I could easily move to that model, but I worry about doing benchmarks on that and sensitivity to disk activity
<brendan> if you want to test the ocaml-level overhead, it's probably better if the file is in the buffer cache. reading from disk will dominate everything else (though there may be differences in prefetching for read vs mmap)
<thelema> i.e. me being able to browse the web while the test runs
<thelema> (this is for my real test, for which I can't share as much code)
<gildor> my test procedure was: run 3 times, take the best time
<thelema> well, reading the same file a gazillion times I think guarantees the file is in the buffer cache
<gildor> and I was not able to browse the web while doing this
<gildor> thelema: no because I took file bigger than memory
<thelema> yup
<brendan> twice will do, but only if you don't have something else evict it in between :)
* gildor gtg
<thelema> well, I want to compare my network protocol parser with another
ymasory has joined #ocaml
<thelema> but I have huge pcap files, and thought that pre-reading them as a string would eliminate the disk access penalty
<thelema> I'd be happy to mmap, but bitstring requires a string.
ftrvxmtrx has joined #ocaml
<thelema> anyway, gotta go, back in 4 hours
<brendan> might be better to let the kernel prefetcher take care of the read pipeline
<brendan> you get lower latency to start and shouldn't be much slower overall
<thelema> I approve of the lower latency, except for the disk access problem
<brendan> well that's what the prefetcher is supposed to hide :)
<flux> it would be extra nice if bitstring supported streaming in
<flux> but, it would break the interface
<flux> thus such a system would perhap better be called bitstring2
rup has joined #ocaml
Yoric has joined #ocaml
<mrvn> thelema: So all the delay is caused by ocaml copying buffers around and the GC cleaning up then.
<mrvn> thelema: mmap should be zero copy as the data is never accessed while pread copies it once from kernel to user space.
<mrvn> Unix.read copies twice and in_channel probably too.
ftrvxmtrx has quit [Ping timeout: 276 seconds]
<flux> hmm..
<flux> I wonder if mmapped ocaml strings would be feasible..
<flux> basically it would work like:
<flux> 1) mmap a region
<flux> 2) mmap zero before it
<flux> 3) stick the mmapped region size into it
<flux> 4) return as ocam lstring!
<flux> but it might not work great with ocaml gc?
ygrek has joined #ocaml
ftrvxmtrx has joined #ocaml
<brendan> is that Bigstring.map_file function doing something like that?
Associat0r has joined #ocaml
<flux> I don't recall seeing that
<flux> perhaps it has arrived at a later version than what I've looked at/used, or it simply reads the file before processing it
<brendan> it looks like it to me, but I have never learned Obj.magic etc
<flux> heh, it appears to do exactly that except in a more researched, ie. more working fashion :)
<flux> ah, biGstring
<flux> I read biTstring
<brendan> yeah, bigstring looks pretty nice
<mrvn> flux: that would have quite an overhead. A full page.
<mrvn> flux: and you would have to make it a custom block with finalizer and then pretend it actually is a string. Not sure the two structures are compatible.
<flux> mrvn, a full page for the integer? well, I would assume it would still be for one, say, pcap file, which would be potentially megabytes
<mrvn> flux: a page for the GC heade before the mmaped data.
<mrvn> For strings the GC header contains the size. Are those bits free in a custom block with finalizer?
<mrvn> Never mind. they must be free as they are the size of the block.
<mrvn> But strings also have a length modifier at the end saying how much of the last word is string iirc. How would you get that after the mmaped data? Add another page and only allow 4k aligned string size?
<mrvn> Another snag would be that the toplevel wouldn't print the string. But I guess for strings >4k that is a good thing.
<flux> forgot about that
<flux> but you can map with private
<flux> and modify the block
<flux> which gets copied-of-write
<flux> s/of/on/
<mrvn> then the file needs to be 4 bytes longer than what you map or the behaviour is undefined. But you can mmap /dev/zero for the last 4 bytes and copy the last chunk into it plus the 4 bytes.
<mrvn> I think for those cases a char bigarray is probably better suited. You can create sub arrays from it when you parse the data into more usefull chunks and such.
<flux> well, even bigarrays are unsuitable for bitstring as of now ;)
<flux> maybe.. a functorized version of bitstring!
<brendan> but does bigstring work with bitstring?
<flux> I seriously doubt that
<flux> but, I need to suspend my laptop, not much power left :)
<mrvn> what does string have that bigarray doesn't?
<brendan> bigstring? it looks like it provides a mmaped file as a string, but I am not good enough at ocaml to tell whether it would work with bitstring
<mrvn> no, I mean string itself. Why does string work for bitstring but not bigarray?
tony_ has quit [Quit: Ex-Chat]
arubin has quit [Ping timeout: 240 seconds]
smerz has joined #ocaml
arubin has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 255 seconds]
ftrvxmtrx has joined #ocaml
tony_ has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
agarwal1975 has joined #ocaml
thieusoai has joined #ocaml
agarwal1975 has quit [Ping timeout: 276 seconds]
agarwal1975 has joined #ocaml
edwin has quit [Remote host closed the connection]
ccasin has quit [Quit: Leaving]
<thelema> mrvn: well, pread is super fast, if that's the case...
thieusoai has quit [Remote host closed the connection]
<thelema> mrvn: and the str_only code allocates the right size string and really_inputs into it - there can't be that much overhead in that copying that it would take 100* more time
<mrvn> thelema: If it is thread safe then it has to allocate a temporary buffer in the C stub, enter_blocking_section(), read into that, leave_blocking_section(), memcpy into the string.
<thelema> I'm reading the stub now..
<mrvn> The problem is that strings can be moved by the GC unlike the data section of a bigarray.
<thelema> it looks like it's dealing with buffered IO
<thelema> true, but I doubt that's causing the higher read time
<thelema> so I either need to patch bitstring to use bigarrays (or bigstrings) or write my own streaming Pcap parser... :(
<mrvn> What is the buffer size of a channel?
<thelema> 4096
<mrvn> Maybe your kernel is using hardware memcpy
<thelema> for pread?
<mrvn> for copy_to_user()
<thelema> that's an impressive difference, if so
<mrvn> You said the file is cached so all pread does is copy the data from cache to userspace.
<mrvn> does the wall clock go down or just the cpu time used?
<thelema> that's still 180MB of memcopy
<thelema> pread: 0.01 WALL ( 0.00 usr + 0.00 sys = 0.00 CPU)
<thelema> for 1.8G of pread
<mrvn> oehm, that is wrong then. too fast.
<mrvn> You allocated the bigarray of proper size?
<thelema> could be a COW
<thelema> let buf = Array1.create char c_layout len in
<thelema> let len = (Unix.stat fn).Unix.st_size in
<mrvn> It could be the bigarray is page aligned and the kernel just mmaps. But I didn't know it checks for that.
<mrvn> flush the caches and see if it goes down to disk speed.
<thelema> could it Copy On Write the pages in the cache?
<mrvn> or try it on a smaller file and check the contents
<mrvn> thelema: theoretically sure.
agarwal1975 has quit [Read error: Connection reset by peer]
agarwal1975 has joined #ocaml
<thelema> oops, pread was broken
ymasory has quit [Remote host closed the connection]
<thelema> running the test again...
<thelema> I forgot to pass the length to pread as well as for creating the buffer
<thelema> oops, that's not the length, that's the offset
<thelema> need more labels
<mrvn> My stub took the length from the bigarray
<thelema> yup, I was thinking it seemed wierd to pass the length twice
<mrvn> so you read from the end and that allways returned 0 bytes then.
<thelema> no, I didn't even pass the last parameter, and my code ignore'd the partially applied function
<thelema> hmm, I wonder if there's a way to get ocaml to warn when ignoreing a functions
<thelema> *function
<thelema> as opposed to ignoring a primitive value
<thelema> anyway, now that I'm iterating through the returned string (or bigarray), ignoring each character, it's taking a bit longer
Yoric has quit [Quit: Yoric]
<thelema> grr, forgot the -1 on bitarray iteration, have to restart test
* thelema puts mmap first
<thelema> hmm, mmap doesn't seem quite so fast... maybe it's the iteration that's not as fast
<thelema> oh yeah, didn't specialize the ba type
<mrvn> page faults are expensive
<thelema> well, it beats the time for my str_only function, but not by too much - 18.8s vs. 23.3s
<thelema> to read and examine 5.4GB
<thelema> and pread is the same time as really_input
<thelema> s/time/speed/
<thelema> hmm, I wonder if the .mli file can specialize codegen in its corresponding .ml
<thelema> I bet it doesn't, meaning we can squeeze out a bit more performance from mfp's widefinder
<thelema> http://pastebin.com/9ak2kUfy <- current rankings
* thelema is going to check this code into batteries VCS and be done for a while
<thelema> and done
BiDOrD has joined #ocaml
BiDOrD_ has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 240 seconds]
<_habnabit> If I'm doing `match i mod 3 with ...`, ocaml complains that my match isn't exhaustive because it doesn't match the value 3.
<_habnabit> Is there a way to not emit the warning?
oriba has quit [Quit: Verlassend]
<brendan> _ -> failwith "impossible" ?
<_habnabit> I suppose!
<_habnabit> I was hoping for something else.
<adrien> for mod 3, if then else will probably be just as good
<_habnabit> I changed it from an if-then because it looked rather ugly. The match is easier to read.
ikaros has quit [Quit: Leave the magic to Houdini]
<mrvn> 0 -> ... | 1 -> ... | _ ->
<_habnabit> Yeah I guess. :(
seafood has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
arubin has quit []
seafood has quit [Ping timeout: 265 seconds]