Loading ...
Sorry, an error occurred while loading the content.

9588Re: "ocaml_beginners"::[] Ocaml and Python (was: Writing to many files)

Expand Messages
  • Johann Spies
    Apr 2, 2008
    • 0 Attachment
      On Tue, Apr 01, 2008 at 03:32:56PM +0100, Jon Harrop wrote:

      > Profiling OCaml is very easy. Just compile with -p, then run and collect
      > profiling results using gprof:
      >
      > $ ocamlopt -p foo.ml -o foo
      > $ ./foo
      > $ gprof foo >profile.txt
      >
      > Right at the top of "profile.txt" will be the most time consuming function,
      > which should be a huge help here!

      Thanks Jon!

      I did that. The top lines show what I have expected: the Scanf and
      PrintF functions dominate. That is called for each line in the files.


      % cumulative self self total
      time seconds seconds calls s/call s/call name
      6.25 208.74 208.74 939026570 0.00 0.00 camlScanf__skip_spaces_391
      4.17 347.83 139.09 3756106280 0.00 0.00 camlScanf__scan_conversion_615
      3.57 466.97 119.14 2653670522 0.00 0.00 camlBuffer__find_ident_141
      3.55 585.34 118.37 3592697092 0.00 0.00 camlScanf__loop_381
      2.46 667.32 81.98 caml_format_exception
      2.37 746.41 79.10 writeblock
      2.32 823.69 77.28 6103672696 0.00 0.00 caml_apply2
      2.30 900.29 76.61 1878053136 0.00 0.00 camlPrintf__scan_conv_275
      2.06 968.94 68.64 1878053134 0.00 0.00 extern_rec
      2.05 1037.24 68.30 1408539853 0.00 0.00 camlPrintf__scan_flags_142
      1.92 1101.21 63.96 939026570 0.00 0.00 camlScanf__entry
      1.73 1159.04 57.83 camlScanf__peek_char_112
      1.66 1214.58 55.54 3592697090 0.00 0.00 camlList__find_225
      1.49 1264.30 49.71 1878053136 0.00 0.00 camlPrintf__sub_fmt_125
      1.27 1306.84 42.54 1878053138 0.00 0.00 camlPrintf__fun_528
      1.20 1346.75 39.91 469513283 0.00 0.00 camlLees_csv__hanteer_92
      1.19 1386.57 39.82 camlPrintf__parse_format_78
      1.18 1425.99 39.42 469513285 0.00 0.00 writecode8
      1.12 1463.40 37.40 3286592991 0.00 0.00 caml_apply3
      1.05 1498.43 35.03 1408539860 0.00 0.00 caml_curry3
      1.00 1531.95 33.52 1408539853 0.00 0.00 camlPrintf__kapr_199
      0.99 1564.83 32.88 469513289 0.00 0.00 caml_MD5Transform
      0.97 1597.20 32.36 400165547 0.00 0.00 caml_ml_output_char
      0.95 1628.75 31.55 469513285 0.00 0.00 camlPervasives__scan_272


      Regards
      Johann
      --
      Johann Spies Telefoon: 021-808 4036
      Informasietegnologie, Universiteit van Stellenbosch

      "There hath no temptation taken you but such as is
      common to man: but God is faithful, who will not
      suffer you to be tempted above that ye are able; but
      will with the temptation also make a way to escape,
      that ye may be able to bear it."
      I Corinthians 10:13
    • Show all 17 messages in this topic