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

refactor(metrics): move to core #12386

Merged
merged 7 commits into from
Oct 10, 2021

Conversation

AaronO
Copy link
Contributor

@AaronO AaronO commented Oct 9, 2021

Avoids overhead of wrapping ops (extra alloc due to reboxing futures for async ops) also stabilizes Deno.metrics().ops.

I'll deprecate byte fields (legacy of previous buffer-based op-layer) in a follow-up PR

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see 100 lines removed. How's the performance?

core/ops.rs Show resolved Hide resolved
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you stabilize typing for Deno.OpMetrics in this PR as well?

@AaronO
Copy link
Contributor Author

AaronO commented Oct 10, 2021

Nice to see 100 lines removed. How's the performance?

Before (main):

date_now:            	n = 500000, dt = 0.032s, r = 15625000/s, t = 64ns/op
op_void_sync:        	n = 10000000, dt = 0.980s, r = 10204082/s, t = 98ns/op
op_void_async:       	n = 1000000, dt = 0.369s, r = 2710027/s, t = 369ns/op
perf_now:            	n = 500000, dt = 0.087s, r = 5747126/s, t = 174ns/op
url_parse:           	n = 50000, dt = 0.086s, r = 581395/s, t = 1719ns/op

After (#12386):

date_now:            	n = 500000, dt = 0.031s, r = 16129032/s, t = 62ns/op
op_void_sync:        	n = 10000000, dt = 0.715s, r = 13986014/s, t = 71ns/op
op_void_async:       	n = 1000000, dt = 0.283s, r = 3533569/s, t = 283ns/op
perf_now:            	n = 500000, dt = 0.076s, r = 6578947/s, t = 151ns/op
url_parse:           	n = 50000, dt = 0.083s, r = 602410/s, t = 1660ns/op

Avoids overhead of wrapping ops, also deprecates byte fields (legacy of previous buffer-based op-layer)
Can deprecate in a separate PR
@AaronO AaronO force-pushed the refactor/ops-metrics-in-core branch from 8337b97 to 963449b Compare October 10, 2021 14:14
@bartlomieju
Copy link
Member

The type declarations are still not updated for OpMetrics (ie. they are still in lib.deno.unstable.d.ts)

@AaronO
Copy link
Contributor Author

AaronO commented Oct 10, 2021

The type declarations are still not updated for OpMetrics (ie. they are still in lib.deno.unstable.d.ts)

Should we stabilize them after stripping the byte fields (and other changes I would like to make) or stabilize .ops now and keep the breaking changes for 2.0 ?

@bartlomieju
Copy link
Member

The type declarations are still not updated for OpMetrics (ie. they are still in lib.deno.unstable.d.ts)

Should we stabilize them after stripping the byte fields (and other changes I would like to make) or stabilize .ops now and keep the breaking changes for 2.0 ?

I'm fine with both approaches as there aren't many known consumers of this API. Your call.

@AaronO
Copy link
Contributor Author

AaronO commented Oct 10, 2021

The type declarations are still not updated for OpMetrics (ie. they are still in lib.deno.unstable.d.ts)

Should we stabilize them after stripping the byte fields (and other changes I would like to make) or stabilize .ops now and keep the breaking changes for 2.0 ?

I'm fine with both approaches as there aren't many known consumers of this API. Your call.

Lets stabilize as is and break in follow-up changes, we can break for 2.0 since the changes would mostly be cleanups instead of imperative improvements

@AaronO AaronO merged commit 5a8a989 into denoland:main Oct 10, 2021
@AaronO AaronO deleted the refactor/ops-metrics-in-core branch October 10, 2021 15:20
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

Successfully merging this pull request may close these issues.

None yet

2 participants