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

[Feature] Profile Section #23

Open
RiftLurker opened this issue May 17, 2017 · 1 comment
Open

[Feature] Profile Section #23

RiftLurker opened this issue May 17, 2017 · 1 comment

Comments

@RiftLurker
Copy link
Contributor

The profiler should be able to profile a certain section of code.

Currently you would have to wrap it into a function and call that:

// some code
profiler.registerFN(() => {
	// some complex code that should get profiled
}, 'mySection') ();
// some code

Because you can't just drop-in section profiling I suggest one of the following alternatives:

// some code
const end = profiler.start('mySection');
// some complex code that should get profiled
end(); // maybe even return profiling data for this section
// some code

or

// some code
profiler.start('mySection');
// some complex code that should get profiled
profiler.end('mySection'); // maybe even return profiling data for this section
// some code

Once this is implemented it should probably also be used internally to wrap functions.

@gdborton
Copy link
Collaborator

This might have some value in terms of checking specific areas of code, but I think that profiling functions is more important. It's more likely that you have an expensive function that is called in several different areas of your app.

I'm not opposed to adding this additional api, but I'd like to feel out how it would work with wrap and registerFN, also what would this look like in the reports?

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