Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Measuring execution time #6

Open
kathsav opened this issue May 19, 2021 · 1 comment
Open

Measuring execution time #6

kathsav opened this issue May 19, 2021 · 1 comment

Comments

@kathsav
Copy link

kathsav commented May 19, 2021

Hi,

I am testing the time needed to visualize large sets of data using this code.
Is it correct measuring it as:

var t1 = performance.now();
    Treemap()
      .data(genNode())
      .color(d => color(d.name))
      .showLabels(false)
      .minBlockArea(8) 
      .excludeRoot(true)
      .tooltipContent((d, node) => `Size: <i>${node.value}</i>`)
      (document.getElementById('chart'));

 var t2 = performance.now();
 console.log(t2 - t1);

Does anything run asynchronously in this case, since I am not sure I receive rational times?

Thank you in advance.

@vasturiano
Copy link
Owner

@kathsav yes, the rendering is done asynchronously, so you won't be able to get accurate numbers in this manner. I would suggest to use the performance tab in your browser to perform this type of profiling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants