Skip to content

Benchmarking js_of_ocaml library with auto only times constructor #38

@WardBrian

Description

@WardBrian

I have been trying to use the new compatibility with js_of_ocaml added in #36.

I have my code organized into a library with the final part of my code being

let () =
  Js.export "somefun" some_function

This is then called in javascript with

var lib = require('./mylib.bc.js');
lib.some_function()

and I run the whole thing with OCAML_LANDMARKS="format=textual" node test.js

Landmarks does produce output, but it seems that it only profiles the setup code being run, not the eventual use of some_function. If I put a print statement in some_function, it is printed after the output of Landmarks, which is full of timings for loading different modules in my code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions