wtetzner has quit [Remote host closed the connection]
wtetzner has joined #ocaml
Heasummn has joined #ocaml
seangrove has joined #ocaml
wtetzner has quit [Ping timeout: 251 seconds]
seangrove has quit [Ping timeout: 244 seconds]
wtetzner has joined #ocaml
SilverKey has joined #ocaml
two_wheels has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
silver has quit [Quit: rakede]
kushal has joined #ocaml
SilverKey has quit [Ping timeout: 260 seconds]
SilverKey has joined #ocaml
jeffmo has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 240 seconds]
wtetzner has quit [Remote host closed the connection]
tmtwd has joined #ocaml
govg has quit [Ping timeout: 258 seconds]
seangrove has joined #ocaml
ygrek has quit [Ping timeout: 276 seconds]
seangrove has quit [Ping timeout: 276 seconds]
unbalancedparen has quit [Ping timeout: 260 seconds]
Heasummn has quit [Read error: No route to host]
MercurialAlchemi has joined #ocaml
<emmanueloga>
Hi. Anybody using ocaml with nixos? Trying to install emacs+merlin. Seems like nixos doesn't include either opam or the merlin package... Any tips are welcome.
averell has quit [Ping timeout: 276 seconds]
seangrove has joined #ocaml
seangrove has quit [Remote host closed the connection]
seangrov` has joined #ocaml
seangrov` has quit [Ping timeout: 276 seconds]
FreeBirdLjj has joined #ocaml
seangrov` has joined #ocaml
tmtwd has quit [Ping timeout: 240 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
martinium has quit [Ping timeout: 258 seconds]
seangrov` has quit [Ping timeout: 252 seconds]
tmtwd has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 264 seconds]
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
martinium has joined #ocaml
seangrov` has joined #ocaml
martinium has quit [Ping timeout: 244 seconds]
seangrov` has quit [Ping timeout: 240 seconds]
pyon has quit [Ping timeout: 258 seconds]
martinium has joined #ocaml
gargawel has quit [Ping timeout: 252 seconds]
gargawel has joined #ocaml
MercurialAlchemi has joined #ocaml
shinnya has joined #ocaml
Algebr` has joined #ocaml
troydm has joined #ocaml
pierpa has quit [Ping timeout: 244 seconds]
fraggle_ has quit [Ping timeout: 264 seconds]
tmtwd has quit [Ping timeout: 244 seconds]
sh0t has joined #ocaml
FreeBird_ has quit [Ping timeout: 265 seconds]
copy` has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has joined #ocaml
zpe has joined #ocaml
Nahra has quit [Ping timeout: 240 seconds]
fraggle_ has joined #ocaml
<regnat>
emmanueloga: They are both included, but in ocamlPackages
<regnat>
(ie merlin is ocamlPackages.merlin and opam is ocamlPackages.opam)
ygrek has joined #ocaml
<Algebr`>
is this something nix related
<regnat>
Algebr`: nixos ? It's a distribution based on nix
<Algebr`>
regnat: I'm meaning are you making an ocaml package for nixpkgs?
<regnat>
There already are
<Algebr`>
I think last I checked there was only like 30
<Algebr`>
regnat: are you writing nix packages or that opam2nix?
<regnat>
Just writing nix packages by hand
pyon has joined #ocaml
<regnat>
(but opam2nix seems worth a shot)
<Algebr`>
I got two packages into nixpkgs, not OCaml, but had high hopes for nix!
<Algebr`>
regnat: I hope you get reproducible success
<regnat>
From a quick search, I see at least 215 ocaml packages in nixpkgs
<Algebr`>
hmm, and how many actually build and work...
<Algebr`>
nix just pulled the rug from under me on one package
<regnat>
Why ?
<Algebr`>
because they mixed and matched gcc with clang when I needed to use clang.
<Algebr`>
so code that compiled fine two months ago stopped compiling
<Algebr`>
because they shared headers and I think mixed and matched libstd++ and libc++
<Algebr`>
(I used nix to avoid this exact issue!)
<regnat>
Oh that's rather ugly...
<Algebr`>
yes, I was very annoyed with it
<Algebr`>
FWIW the solution in that problem is to do a checkout of nixpkgs, checkout the commit that you added the package and then: nix-env -f /path/to/checkout_nixpkgs -i <package_name>
<regnat>
especially since that's something nix should make a lot more easy to avoid
<Algebr`>
Ah I see, I thought you mean that examples for the C library itself were all different
<johnelse>
Ah no :)
SilverKey has quit [Quit: Halted.]
agarwal1975 has quit [Quit: agarwal1975]
agarwal1975 has joined #ocaml
SilverKey has joined #ocaml
FreeBirdLjj has joined #ocaml
silver has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 264 seconds]
SilverKey has quit [Quit: Halted.]
kakadu has joined #ocaml
kushal has quit [Ping timeout: 244 seconds]
kushal has joined #ocaml
jeffmo has joined #ocaml
tvynr has quit [Ping timeout: 244 seconds]
freehck has joined #ocaml
tane has quit [Quit: Verlassend]
al-damiri has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 244 seconds]
Denommus has joined #ocaml
Denommus has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
SilverKey has joined #ocaml
Algebr` has quit [Ping timeout: 244 seconds]
Algebr` has joined #ocaml
pierpa has joined #ocaml
tvynr has joined #ocaml
Algebr` has quit [Ping timeout: 252 seconds]
sh0t has quit [Remote host closed the connection]
regnat[m] has joined #ocaml
M-martinklepsch has joined #ocaml
M-jimt has joined #ocaml
Bluddy[m] has joined #ocaml
M-ErkkiSeppl has joined #ocaml
barkmadley[m] has joined #ocaml
M-pesterhazy has joined #ocaml
M-Illandan has joined #ocaml
two_wheels has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
two_wheels has joined #ocaml
<jmct>
Hey all, I tried here yesterday and no one was able to help me. Anyone have experience with profiling programs that have been preprocessed with camlp5?
<kakadu>
guys from #coq should know something about it....
<kakadu>
jmct: Locations are going wild or another problem?
<jmct>
I can't even get the gmon.out file from passing -p
<jmct>
when I try it on a simple project it works fine
<jmct>
frustrating, since there's obviously something I'm not taking into account
<kakadu>
It should be some simple error
<kakadu>
do you use ocamlfind?
<kakadu>
for both projects?
<jmct>
yep
NingaLeaf has joined #ocaml
<jmct>
At first I wasn't preprocessing the files beforehand, I then read that -p and -pp don't play well together, so I now batch preprocess the files and then build as normal
MercurialAlchemi has joined #ocaml
<kakadu>
sounds a little bit ugly
<kakadu>
maybe it is a good idea to get rid from camlp5?
<jmct>
yes, I think that's a good idea
<jmct>
I inherited this codebase and it seems to have grown out of control haha. Maybe today I'll find a way to eliminate camlp5. Thanks for being hearing me out :)
NingaLeaf has left #ocaml ["Leaving"]
<kakadu>
btw, which project do you work with?
<kakadu>
any chance it is related to genealogy?
govg has quit [Ping timeout: 252 seconds]
<jmct>
no, it's a quantitative information flow project at Galos
<jmct>
Galois*, even
dexterph has quit [Ping timeout: 250 seconds]
ohama has quit [Ping timeout: 244 seconds]
govg has joined #ocaml
<gasche>
jmct: for profiling OCaml programs I use (ocamlopt -p), then gprof, or (ocamlopt -g) then (perf record --call-graph=dwarf)
<gasche>
none of them are impacted by using a specific preprocessor, I believe
Nahra` has quit [Remote host closed the connection]
<jmct>
gasche: Thanks I had been trying -p but didn't know about -g
<jmct>
-p is now working in that we get call count information but no timing information
Nahra has joined #ocaml
thizanne has joined #ocaml
silver has quit [Quit: rakede]
ohama has joined #ocaml
<gasche>
jmct: I suspect you are using the bytecode compiler (ocamlc) rather than the native compiler (ocamlopt)
ontologiae has quit [Ping timeout: 250 seconds]
<gasche>
(ocamlopt -p) and gprof give more accurate profiling information than (ocamlc -p) and ocamlprof
<gasche>
besides, native binaries is fastest in the first place, and what you should use in performance-demanding situations (those that require profiling)
slash^ has joined #ocaml
<gasche>
s/is fastest/are faster/
kushal has quit [Ping timeout: 258 seconds]
jeffmo has quit [Quit: jeffmo]
govg has quit [Ping timeout: 252 seconds]
govg has joined #ocaml
<jmct>
hmm, I thought we were using ocamlopt, but I'll make sure the makefile isn't doing something silly
<jmct>
thanks, gasche!
FreeBirdLjj has joined #ocaml
govg has quit [Ping timeout: 260 seconds]
govg has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 265 seconds]
soupault has quit [Remote host closed the connection]
kdas__ has joined #ocaml
ChristopheT has joined #ocaml
govg has quit [Ping timeout: 258 seconds]
kdas__ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
govg has joined #ocaml
dedgrant has quit [Quit: Leaving]
AltGr has left #ocaml [#ocaml]
silver has joined #ocaml
govg has quit [Ping timeout: 252 seconds]
govg has joined #ocaml
dexterph has joined #ocaml
kandu has quit [Ping timeout: 244 seconds]
sheijk has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
govg has joined #ocaml
kandu has joined #ocaml
kandu is now known as Guest41028
SilverKey has quit [Read error: Connection reset by peer]
xenny has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ygrek has joined #ocaml
xenny has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
melanargia1 has joined #ocaml
melanargia1 has quit [Client Quit]
Nahra has quit [Ping timeout: 250 seconds]
kakadu has joined #ocaml
<flux>
so 4.04.0+beta1 was announced. who else hoped it to have multicore?-(
<flux>
though it was said to come in an alpha version ;-)
Nahra has joined #ocaml
octachron has joined #ocaml
fuhdsufihds has joined #ocaml
fuhdsufihds has left #ocaml [#ocaml]
SilverKey has quit [Quit: Halted.]
<jmct>
gasche: Do you ever run into seg faults with perf report?
ggole has quit []
jhonatanoliveira has joined #ocaml
SilverKey has joined #ocaml
<jhonatanoliveira>
Hello. I am trying to understand what's going on in a piece of OCaml code. I open a file to populate a data structure. Later, we time a task using that data structure. But when we do not open the file (creating a randomly populate the data structure), the timing for the same task is a faster than the one opening the file. So, I was wondering if ope
<jhonatanoliveira>
ning a file can interfere somehow in the execution speed later on in the code.
<flux>
doesn't seem like it
<flux>
might the contents of the file matter? it's not random, is it?
<jhonatanoliveira>
Ok. It make sense. Maybe it's something in the data structure then. Just wanted to make sure. Thank you, flux
<jhonatanoliveira>
Not it's not random indeed
<flux>
for example if the data is array indices, then random access would minimize the cache effects
<flux>
as it's faster to read an array from the beginning to the end than in random order
<jhonatanoliveira>
that makes sense
<gasche>
jmct: what is your OS and OCaml version?
<jhonatanoliveira>
The thing is: if I run two cases, in one I open a file, but dont use the data. In another one, I dont open the file and also dont use the data. The case opening the file is slower than then you don't open. Notice that I only time the task after opening (or not opening) the file
<gasche>
you may want to try without the --call-graph=dwarf option, so that the dwarf information is not processed (it might be buggy)
<flux>
jhonatanoliveira, can you share the program?
<jhonatanoliveira>
MacOS
<jmct>
gasche: I've tried both with and without, doesn't seem to matter
<jhonatanoliveira>
flux, I would need permission for that, I am sorry
<jmct>
OS: Linux debian-jessie 3.16.0-4-amd64 and ocaml: The OCaml toplevel, version 4.02.0
<gasche>
hm
<jmct>
this may not be an OCaml issue
<flux>
jhonatanoliveira, do you use ocamlc or ocamlopt?
<gasche>
jmct: I don't know, sorry
<jmct>
no worries, just thought I'd ask
<flux>
jhonatanoliveira, and how big differences are we talking about?
SilverKey has quit [Quit: Halted.]
<jhonatanoliveira>
flux I'm new to OCaml and I'm working in a library called Libra. I use their build system, so I am not sure which one they use
<jhonatanoliveira>
flux it's around 30%
SilverKey has joined #ocaml
bruce_r has quit [Ping timeout: 258 seconds]
SIGILL has quit [Ping timeout: 250 seconds]
xenny has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
SilverKey has quit [Quit: Halted.]
<flux>
jhonatanoliveira, that's quite a significant difference
<flux>
jhonatanoliveira, I think a more likely explanation could be that you ie. accidentally open the file numerous times instead of just once..
<flux>
jhonatanoliveira, one approach to solving this might be replacing the algorithm-essential code with nothing (or some busywork like for-loops) and get a minimized version that only opens the file and does some looping.. if that's possible
<flux>
that version then would be possible to share with anyone :)
SilverKey has joined #ocaml
SilverKey has quit [Client Quit]
slash^ has quit [Read error: Connection reset by peer]
<mrvn>
jhonatanoliveira: Execution speed is often changed by the GC minor heap size. With the file open you might exceed the minor heap so a garbage collection happens and you measure that. Without the file you just manage to fit in the minor heap and no collection happens.
<mrvn>
Try doing a "Gc.full_major ()" before you measure.
<jhonatanoliveira>
Thank you @mrvn. The file isn't that big, but it makes sense that GC is getting in. The thing is that I'm not timing the opening of the file itself, but only the task right after.
<mrvn>
If you asre parsing the file that will put a lot of stuff in the minor heap. So huge difference if you don't clean that up before the algorithm.
<mrvn>
s/asre/parse/
<mrvn>
s/asre/are/ I mean.
SilverKey has joined #ocaml
<jhonatanoliveira>
Oh, I see. Yes, it could be it, I will try cleaning it before
<mrvn>
On the other hand a GC loop isn't that long. how much is the difference?
SIGILL has joined #ocaml
<jhonatanoliveira>
Also, flux siggested that my timer is not precise, since I'm using Sys.time and I'm trying to catch times around 0.001 sec. Is there any other precise timer for ocaml besides Unix?
<mrvn>
lol, make your test case to run for a minute or so.
<jhonatanoliveira>
The diff is around 30% accordingly to Sys.time
<mrvn>
jhonatanoliveira: 30% of 0.001 seconds is nothing. 30% of 1000s is a lot.
<jhonatanoliveira>
lol sure, but the thing is that our experiment is measuring this small amount...
<mrvn>
you probably want to use the cpu cycle counter then. Would need some C stubs with inline asm.
SilverKey has quit [Client Quit]
<jhonatanoliveira>
Oh I see. I'll take a look at that. There isn't anything in Ocaml, right?
<jhonatanoliveira>
With that precision, I mean
<mrvn>
jhonatanoliveira: not that I know of.
SilverKey has joined #ocaml
<mrvn>
My Sys.time jumps in steps of 0.004
<mrvn>
- : float = 0.144
<mrvn>
- : float = 0.148
<mrvn>
- : float = 0.152
<jhonatanoliveira>
Ok, that explains a bit. Thank you @mrvn, I'll take a look in these ideas
<jhonatanoliveira>
Looks like a good precision for me :)
<mrvn>
A lot more precise than Sys.time but cpu cycle time is about the same magnitude better again.
<mrvn>
(~10-9)
myst|fon has quit [Quit: Connection closed for inactivity]
<mrvn>
Note that Unix.gettimeofday is wall clock time. So you get errors when the process gets scheduled and multiple threads don't get added up (not a problem in ocaml usualy).
cat5e is now known as apng
<jhonatanoliveira>
You mean that cpu cycles would be more precise?
<mrvn>
jhonatanoliveira: the cpu cycle counter counts cpu cycles. So a 2GHz cpu runs the counter at 2GHz. Can't get more precise than that.
<mrvn>
It's what you use when you want to time something as small as 50 opcodes.
apng is now known as APNG
<jhonatanoliveira>
Nice, I think we might need that one. I'll just try Unix first (trying to open the module inside this library)
<mrvn>
jhonatanoliveira: I recommend running your algorithm 100 times in a loop and then measure 10 times and output the median time.
<mrvn>
average out the jitter.
<jhonatanoliveira>
I was doing that actually, but with Sys.time, I'll try Unix now
<mrvn>
you can also check the GC stats to see if a collection happened during the measurement.
<mrvn>
would let you see if the open/not open difference actually is a GC skew.
<mrvn>
Also you should disable address space randomization since that can skew the speed too.
<mrvn>
(or run the programm often enough to average that out)
<jhonatanoliveira>
Ok, I'm not familiar with these concepts, but I'll look for them and try one at a time :)
<mrvn>
jhonatanoliveira: The kernel puts libraries and stack at somewhat random locations so a hacker can't guess their location when attacking e.g. over network. But that changes the cache alignment of data so code can be faster or slower depending on placement.
<mrvn>
Similar: FOO="bla" ./blub and FOO="blafasel" ./blub can have different timeing because the environment changes the stack location too.
<mrvn>
Mostly a problem when someone else wants to repeat you measurements and gets different results.
<jhonatanoliveira>
Nice. Thank you @mrvn. I gotta go, but all thee info were very helpful