Re: Core.Time.Map splitting and performance
"Johan Mazel [email protected] [ocaml_beginners]" <[email protected]> Thu, 13 Oct 2016 14:16:08 +0900
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <CAKS5mhSSBaW6CnUxspq7FnJPGVmqGyjvVCh-0ObQsBqZPY_GSQ@mail.gmail.com> |
Hi I figured out why the split function is taking some time by examining the code. It is actually calling the join function which in turn call bal which balance the tree and thus call length a lot. Thank you all for your help. Regards, Johan 2016-09-18 19:30 GMT+09:00 Johan Mazel <[email protected]>: > Hi > I took the time to write a small example: https://gist.github.com/johanm > azel/a9cab64242b3c84b2cbd0c53192313b2. > > When I do "perf record --call-graph=dwarf *.native" and "perf report", I > get around 40% of time in Core_kernel.Core_map.length. > > Thank you for your time. > > Regards, > Johan > > > 2016-05-24 21:14 GMT+09:00 Gabriel Scherer [email protected] > [ocaml_beginners] <[email protected]>: > >> >> >> I don't think the beginners list keeps attached files; could you >> upload it somewhere on the internet instead? >> >> Note that by using >> perf record --call-graph=dwarf >> you can get perf to also collect backtraces and provide more >> informative profiling results -- in particular you could know who's >> calling this function. >> >> https://ocaml.org/learn/tutorials/performance_and_profiling. >> html#UsingperfonLinux >> >> On Mon, May 23, 2016 at 10:59 PM, Johan Mazel [email protected] >> [ocaml_beginners] <[email protected]> wrote: >> > Hello >> > I am trying to build a very big (100k to 1M elements) map of Core.Time.t >> > that contains some data. >> > I then want to repeatedly split it (to extract time windows). >> > I use the Core.Time.Map.split function. >> > >> > Using perf to profile the execution, it appears that most of the time is >> > actually spent in Core_kernel.Core_map.length. >> > You can try with the code I attached. >> > >> > I took a quick look at the core_kernel code on Github but I couldn't >> find >> > an explanation. >> > Is there any explanation for this ? Tree balancing ? >> > >> > Thank you for your time. >> > Regards, >> > Johan >> > >> > >> > [Non-text portions of this message have been removed] >> > >> > >> > >> > ------------------------------------ >> > Posted by: Johan Mazel <[email protected]> >> > ------------------------------------ >> > >> > Archives up to December 31, 2011 are also downloadable at >> http://www.connettivo.net/cntprojects/ocaml_beginners >> > The archives of the very official ocaml list (the seniors' one) can be >> found at http://caml.inria.fr >> > Attachments are banned and you're asked to be polite, avoid flames etc. >> > ------------------------------------ >> > >> > Yahoo Groups Links >> > >> > >> > >> >> > >