caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamlopt debugging options
@ 2009-04-23 10:30 Alexey Rodriguez
  2009-04-23 10:34 ` [Caml-list] " Mark Shinwell
  0 siblings, 1 reply; 7+ messages in thread
From: Alexey Rodriguez @ 2009-04-23 10:30 UTC (permalink / raw)
  To: caml-list

Dear List,

Sometimes it is useful to see what is the code produced by ocamlopt in
order to assess the performance of programming constructs. It is
possible to use -dcmm, but it is difficult to relate ocaml functions
to their compiled form due to the names used in the cmm dump. How do
you people get around that difficulty?

One more thing, are the ocamlopt undocumented options documented somewhere? :)

Cheers,

Alexey


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] ocamlopt debugging options
  2009-04-23 10:30 ocamlopt debugging options Alexey Rodriguez
@ 2009-04-23 10:34 ` Mark Shinwell
  2009-06-18 13:52   ` Alexey Rodriguez
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Shinwell @ 2009-04-23 10:34 UTC (permalink / raw)
  To: Alexey Rodriguez; +Cc: caml-list

On Thu, Apr 23, 2009 at 12:30:31PM +0200, Alexey Rodriguez wrote:
> Sometimes it is useful to see what is the code produced by ocamlopt in
> order to assess the performance of programming constructs. It is
> possible to use -dcmm, but it is difficult to relate ocaml functions
> to their compiled form due to the names used in the cmm dump. How do
> you people get around that difficulty?

I use objdump -Dr :)

Mark


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] ocamlopt debugging options
  2009-04-23 10:34 ` [Caml-list] " Mark Shinwell
@ 2009-06-18 13:52   ` Alexey Rodriguez
  2009-06-18 13:57     ` Daniel Bünzli
  2009-06-18 14:10     ` Mark Shinwell
  0 siblings, 2 replies; 7+ messages in thread
From: Alexey Rodriguez @ 2009-06-18 13:52 UTC (permalink / raw)
  To: Mark Shinwell; +Cc: caml-list

On Thu, Apr 23, 2009 at 12:34 PM, Mark
Shinwell<mshinwell@janestcapital.com> wrote:

> I use objdump -Dr :)

Ok. It took me a long to reply to this, but better late than never.

I used objdump as you suggested and I do not mind reading assembler
but I have the same problem as with cmm, namely that symbolic names
are gone.

So, I repeat my question. How do you people do to relate labels in the
generated code with the ocaml function names in the source?

Thanks!

Alexey


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] ocamlopt debugging options
  2009-06-18 13:52   ` Alexey Rodriguez
@ 2009-06-18 13:57     ` Daniel Bünzli
  2009-06-18 14:10       ` Alexey Rodriguez
  2009-06-18 14:10     ` Mark Shinwell
  1 sibling, 1 reply; 7+ messages in thread
From: Daniel Bünzli @ 2009-06-18 13:57 UTC (permalink / raw)
  To: Alexey Rodriguez; +Cc: OCaml List


Le 18 juin 09 à 15:52, Alexey Rodriguez a écrit :

> I used objdump as you suggested and I do not mind reading assembler
> but I have the same problem as with cmm, namely that symbolic names
> are gone.

If you compile with -S they should not be gone in the generated  
assembly file. More explanations here :

http://ocaml-tutorial.org/performance_and_profiling

Best,

Daniel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] ocamlopt debugging options
  2009-06-18 13:52   ` Alexey Rodriguez
  2009-06-18 13:57     ` Daniel Bünzli
@ 2009-06-18 14:10     ` Mark Shinwell
  2009-06-18 14:11       ` Alexey Rodriguez
  1 sibling, 1 reply; 7+ messages in thread
From: Mark Shinwell @ 2009-06-18 14:10 UTC (permalink / raw)
  To: Alexey Rodriguez; +Cc: caml-list

On Thu, Jun 18, 2009 at 03:52:46PM +0200, Alexey Rodriguez wrote:
> I used objdump as you suggested and I do not mind reading assembler
> but I have the same problem as with cmm, namely that symbolic names
> are gone.

Exactly what form of symbolic name are you referring to?  Function names
are preserved (although they are mangled, but it's a lot easier to
decipher than C++ mangling).

Mark


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] ocamlopt debugging options
  2009-06-18 13:57     ` Daniel Bünzli
@ 2009-06-18 14:10       ` Alexey Rodriguez
  0 siblings, 0 replies; 7+ messages in thread
From: Alexey Rodriguez @ 2009-06-18 14:10 UTC (permalink / raw)
  To: Daniel Bünzli; +Cc: OCaml List

2009/6/18 Daniel Bünzli <daniel.buenzli@erratique.ch>:

>
> If you compile with -S they should not be gone in the generated assembly
> file. More explanations here :
>
> http://ocaml-tutorial.org/performance_and_profiling

Thank you! It was my silly mistake after all. I was testing a small
program to see whether functions would be inlined. Ocaml did inline
them and that is why I did not see them! :)

One more question regarding code generation and optimization. Has
anyone in this list used monads in production code? The core library
from Jane Street uses monads, so I suppose they are used over there.
Can people comment on their efficiency (or lack thereof)?

The experiments I am doing are to test whether Ocaml can inline most
uses of bind.

Cheers,

Alexey


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] ocamlopt debugging options
  2009-06-18 14:10     ` Mark Shinwell
@ 2009-06-18 14:11       ` Alexey Rodriguez
  0 siblings, 0 replies; 7+ messages in thread
From: Alexey Rodriguez @ 2009-06-18 14:11 UTC (permalink / raw)
  To: Mark Shinwell; +Cc: caml-list

On Thu, Jun 18, 2009 at 4:10 PM, Mark
Shinwell<mshinwell@janestcapital.com> wrote:
>
> Exactly what form of symbolic name are you referring to?  Function names
> are preserved (although they are mangled, but it's a lot easier to
> decipher than C++ mangling).

You are absolutely right. I was my own mistake, see the other message. Thanks!

Cheers,

Alexey


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-06-18 14:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-23 10:30 ocamlopt debugging options Alexey Rodriguez
2009-04-23 10:34 ` [Caml-list] " Mark Shinwell
2009-06-18 13:52   ` Alexey Rodriguez
2009-06-18 13:57     ` Daniel Bünzli
2009-06-18 14:10       ` Alexey Rodriguez
2009-06-18 14:10     ` Mark Shinwell
2009-06-18 14:11       ` Alexey Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).