<oriba>
mark_slice eats up about 10% of my time, caml_page_table_lookup about 7%
<oriba>
how can I optimize?
<adrien>
operating on big sets?
everyonemines has joined #ocaml
<oriba>
using ocamlgraph; not sure what it is internally, but I also use Map
<oriba>
the program easty nearly all my ram
<oriba>
and swaps
<oriba>
but the above mentioned gprof reults are without swapping
<oriba>
but nevertheless it needs much ram
<adrien>
I mean: do you yse a set/map/whatever with lots oelements?
<oriba>
4194304 entries
<oriba>
so, it's not a very small number
<everyonemines>
You can use Array.iter instead
<oriba>
depends on what you understand under "lots"
<everyonemines>
and do in-place operations
<adrien>
you can try to tweak the garbage collector to make it work less, see the documentation of the Gc module
<everyonemines>
map creates a new array every time, then it needs to be GC'd
<adrien>
of course, not giving work to the gc in the first place is an even better solution
<adrien>
if you want to play with Gc, increase the size of the minor heap
<oriba>
ok, I will try this
<adrien>
night
<oriba>
can#t this be done via OCAMLRUNPARAM?
<oriba>
night, adrien
<adrien>
it can iirc
<oriba>
ok
<everyonemines>
but it sounds to me you need to write more imperative style code
<oriba>
hmhh
<oriba>
I used pcamlgraph with imperative ...
<oriba>
I used ocamlgraph with imperative graphs
<oriba>
maybe it's just too much data?
<oriba>
the program needs up to more than 1.2 GB
<oriba>
maybe I need to change my data from strings to int's, before feeding into the graphs
<adrien>
Gc.(increase minor_heap_size to fit the L2 cache, lower space_overhead before a compaction, trigger compactions when you want them to happen)
emmanuelux has quit [Ping timeout: 240 seconds]
<oriba>
adrien, I tried around with Gc.compact and usd print_stats from Gc. here the stats beofre and after a Gc.compact(): http://paste.pocoo.org/show/515612/
<oriba>
does this say you something?
<oriba>
(I'm far from being a Gc expert...)
<oriba>
with "minor_heap_size to fit the L2 cache", you mean the minor heap size should be as big as the L2 cache?
destrius has joined #ocaml
<oriba>
hmhh-... with a bigger minor heap size, now mark_size is down to 7%
<oriba>
and compare_val is at top now ;)
nixfreak has quit [Ping timeout: 244 seconds]
jknick has joined #ocaml
nixfreak has joined #ocaml
oriba has quit [Quit: oriba]
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
adrien has quit [Read error: Operation timed out]
jknick has quit [Quit: leaving]
adrien has joined #ocaml
jknick has joined #ocaml
sepp2k1 has quit [Remote host closed the connection]
sebz_ has quit [Quit: Computer has gone to sleep.]
khia0 has joined #ocaml
khia0 has left #ocaml []
dsheets has quit [Ping timeout: 244 seconds]
nixfreak has quit [Ping timeout: 252 seconds]
dsheets has joined #ocaml
sebz has joined #ocaml
sebz has quit [Client Quit]
sebz has joined #ocaml
Drakken has joined #ocaml
dnolen has joined #ocaml
dnolen has quit [Quit: dnolen]
<everyonemines>
the guy here the other day wanted to know what I was working on
<everyonemines>
it's an automatic regex generator from examples
arubin has quit [Quit: arubin]
<Drakken>
dan[~]$ ocaml
<Drakken>
Objective Caml version 3.12.1
<Drakken>
# #load "camlp4o.cma";;
<Drakken>
Error: Reference to undefined global `Dynlink'
<Drakken>
oh goodie
<Drakken>
more linking issues
larhat has joined #ocaml
ulfdoz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
chmmn has joined #ocaml
chmmn has quit [Quit: 离开]
chmmn has joined #ocaml
<Drakken>
# Grammar.Entry.print Pcaml.expr;;
<Drakken>
Error: Unbound module Grammar
ankit9 has quit [Quit: Leaving]
EmmanuelOga has quit [Ping timeout: 244 seconds]
<everyonemines>
what are you trying to use camlp4 for
<everyonemines>
and do you have findlib installed
ulfdoz has quit [Ping timeout: 260 seconds]
<Drakken>
I have findlib, although I haven't been using it for this particular program, and want to use camlp4 to write some macros/syntax extensions.
<everyonemines>
#use "topfind";;
<everyonemines>
#require "library";;
<Drakken>
I didn't download any packages.
chmmn has quit [Quit: 离开]
<everyonemines>
Huh? That's how you use libraries in the toplevel with findlib.
<Drakken>
Why do I need findlib when the libs are all in /usr/local/lib/*?
hto_ has quit [Quit: Lost terminal]
hnrgrgr has quit [Ping timeout: 258 seconds]
hnrgrgr has joined #ocaml
ftrvxmtrx_ has joined #ocaml
ankit9 has joined #ocaml
raichoo has joined #ocaml
<everyonemines>
Did you get it working then?
edwin has joined #ocaml
emmanuelux has joined #ocaml
cago has joined #ocaml
ankit9 has quit [Quit: Leaving]
ankit9 has joined #ocaml
milosn has joined #ocaml
ikaros has joined #ocaml
<adrien>
Drakken: rely on ocamlfind/findlib
<adrien>
in the toplevel: #use "topfind";; #camlp4o;;
<Drakken>
File "./camlp4.ml", line 1, characters 0-30:
<Drakken>
Error: Unbound module Camlp4
<adrien>
can you try without -linkpkg?
<Drakken>
adrien then how do I display the current standard grammar?
<adrien>
it's *only* used when linking
<Drakken>
adrien no change.
<adrien>
this is the error I get: Error: Unbound module Camlp4.Sig.Grammar.Entry
<adrien>
does it say "Camlp4" or "Camlp4.Sig.Grammar.Entry"?
<Drakken>
just "Camlp4"
<adrien>
how did you install ocaml/findlib?
<adrien>
also, don't pass -package dynlink; ocamlfind pulls that as a dependency automatically
<Drakken>
I think I downloaded the tarball for each and installed according to the INSTALL file or whatever was in the distribution.
ikaros has joined #ocaml
<Drakken>
Oh, and do I really want camlp4, or is it camlp5? I don't see camlp5 in `ocamlfind list`, but that's the new name of the old syntax system, right? So are my camlp4 libs the old or the new? And if they're the new, is there a Grammar module in the new system or did that get changed?
<adrien>
camlp5 is the new name of the old camlp4, yes
<Drakken>
wtf
<Drakken>
It's like they're trying to confuse things as much as possible.
<flux>
and succeeding!
<adrien>
yruk
<Drakken>
with me at least :(
<flux>
it is indeed quite confusing. too bad inria never thought of changing the name when they made the new backwards-incompatible version.
<adrien>
camlp5 in godi seems fubared: no META and it's installed under "std-lib"
<adrien>
flux: it's not too late for a new name! :P
<adrien>
so we can have three names =)
<flux>
I think the damage has been done already
<Drakken>
So what are all these camlp4 libs in my installation? New or old?
<adrien>
neqw
<adrien>
new*
<flux>
was it ocaml 3.09 that still had the old camlp4?
<diml>
yes
_andre has joined #ocaml
<adrien>
I didn't know it was possible for a package in godi not to have a META file; camlp5 proved me wrong ><
<Drakken>
So the Grammar module might have been moved or renamed or something.
<diml>
Drakken: the Grammar module is Camlp4.PreCast.Gram
<diml>
your example is now: Camlp4.PreCast.Gram.Entry.print Format.std_formatter Camlp4.PreCast.Syntax.expr
<Drakken>
diml are there some docs somewhere?
destrius has quit [Quit: Leaving.]
<diml>
i don't know, i only read Sig.ml from the ocaml sources...
<Drakken>
diml okay thanks
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
Cyanure has joined #ocaml
<Drakken>
diml how do you know Gram is inside Camlp4.PreCast?
sebz_ has joined #ocaml
<Drakken>
oh, I guess it's in PreCast.mli
<Drakken>
What's the status of the revised syntax? Is it recommended for new code?
<flux>
I'm under the impression that a minority uses it, and it doesn't seem like it's about to change
ikaros has quit [Ping timeout: 252 seconds]
<flux>
also perhaps it's a little bit more difficult to teach to newcomers, given that it requires the use of camlp4 and camlp4 error messages are worse than non-camlp4-errors :(
raichoo has quit [Read error: Connection reset by peer]
raichoo has joined #ocaml
<adrien>
I like half of it; would it be possible to have a mix? =)
musically_ut has joined #ocaml
ikaros has joined #ocaml
ankit9 has quit [Ping timeout: 248 seconds]
<musically_ut>
Is there a way of converting generic exceptions to string?
<adrien>
musically_ut: see the Printexc module
<adrien>
for use in a particular setting?
<musically_ut>
adrien, looking at it, thanks.
<musically_ut>
adrien, perfect, just what I needed for prototyping.
<adrien>
=)
ftrvxmtrx_ has quit [Quit: Leaving]
ftrvxmtrx_ has joined #ocaml
sebz_ has quit [Quit: Computer has gone to sleep.]
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
Cyanure has quit [Remote host closed the connection]
<diml>
for the "let module M = ..." i don't remember how i found this
probst has quit [Quit: probst]
dnolen has joined #ocaml
dnolen has quit [Client Quit]
ankit9 has quit [Quit: Leaving]
spearalot has joined #ocaml
raichoo has quit [Quit: leaving]
<Drakken>
diml thanks
Drakken has left #ocaml []
ijp has joined #ocaml
sebz has joined #ocaml
Drakken has joined #ocaml
kuscotopia has joined #ocaml
<kuscotopia>
How can I define a Hashtbl of a certain type within a record?
hto has joined #ocaml
<kuscotopia>
I know I can use Hashtbl.create and Hashtbl.add to define the type of the hash table...but I would like to do so within a type definition.
<thelema>
kuscotopia: type r = {x: (int, string) Hashtbl.t}
<kuscotopia>
You all always make it look so easy.
<kuscotopia>
Thank you.
<thelema>
:)
oriba has quit [Quit: oriba]
sebz has quit [Quit: Computer has gone to sleep.]
cago has quit [Quit: Leaving]
ulfdoz has joined #ocaml
ftrvxmtrx_ has quit [Quit: Leaving]
ankit9 has joined #ocaml
thelema has quit [Ping timeout: 245 seconds]
larhat has quit [Quit: Leaving.]
thelema has joined #ocaml
maufred has quit [Quit: leaving]
edwin has joined #ocaml
spearalot has quit [Quit: Computer has gone to sleep]
_habnabit has quit [Changing host]
_habnabit has joined #ocaml
ttamttam has joined #ocaml
jonludlam has left #ocaml []
Modius has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
kuscotopia has left #ocaml []
emmanuelux has joined #ocaml
ankit9 has quit [Quit: Leaving]
Anarchos has joined #ocaml
ftrvxmtrx has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
sepp2k has quit [Ping timeout: 248 seconds]
sepp2k has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
metadave has joined #ocaml
metadave has left #ocaml []
ttamttam has quit [Read error: Connection reset by peer]
_andre has quit [Quit: leaving]
andre__ has joined #ocaml
andre__ is now known as Guest42039
Guest42039 has quit [Ping timeout: 244 seconds]
andre___ has joined #ocaml
andre___ is now known as Guest31583
Guest31583 has quit [Client Quit]
ygrek has joined #ocaml
nixfreak has quit [Remote host closed the connection]
ikaros has joined #ocaml
raichoo has joined #ocaml
fschwidom has joined #ocaml
srcerer has quit [Quit: ChatZilla 0.9.87 [Firefox 3.6.24/20111103063747]]
srcerer has joined #ocaml
sepp2k has quit [Remote host closed the connection]