-
Notifications
You must be signed in to change notification settings - Fork 290
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
breaking: Remove the FromArgs
impl on T: TryFromJs
and add cx.arg()
and cx.arg_opt()
.
#1096
Open
kjvalencik
wants to merge
3
commits into
main
Choose a base branch
from
kv/no-args
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+41
−30
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading status checks…
…g()` and `cx.arg_opt()`. A blanket impl was added to avoid duplicate methods or a confusing `let (n,) = cx.args()?;` syntax for unary functions. However, this does not work well with the `#[neon::export]` macro where functions with zero arguments end up unnecessarily deserializing `undefined`.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1096 +/- ##
=======================================
Coverage 83.42% 83.42%
=======================================
Files 74 74
Lines 5537 5546 +9
Branches 5537 5546 +9
=======================================
+ Hits 4619 4627 +8
- Misses 803 806 +3
+ Partials 115 113 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Branch | kv/no-args |
Testbed | ubuntu-latest |
🚨 10 Alerts
Benchmark | Measure Units | View | Benchmark Result (Result Δ%) | Lower Boundary (Limit %) | Upper Boundary (Limit %) |
---|---|---|---|---|---|
JsFunction::bind | Latency nanoseconds (ns) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 198.67 ns(-5.78%)Baseline: 210.86 ns | 208.75 ns (105.07%) | 421.73 ns (47.11%) |
JsFunction::bind | Throughput operations / second (ops/s) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 4,914,643.21 ops/s(+4.69%)Baseline: 4,694,405.32 ops/s | 0.00 ops/s (0.00%) | 4,741,349.37 ops/s (103.65%) |
JsFunction::call_with | Latency nanoseconds (ns) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 202.07 ns(-3.39%)Baseline: 209.17 ns | 207.07 ns (102.48%) | 418.33 ns (48.30%) |
JsFunction::call_with | Throughput operations / second (ops/s) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 4,861,292.81 ops/s(+2.69%)Baseline: 4,733,974.83 ops/s | 0.00 ops/s (0.00%) | 4,781,314.58 ops/s (101.67%) |
auto-exported-noop | Latency nanoseconds (ns) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 28.04 ns(-27.32%)Baseline: 38.58 ns | 38.20 ns (136.22%) | 77.16 ns (36.34%) |
auto-exported-noop | Throughput operations / second (ops/s) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 34,981,675.55 ops/s(+26.84%)Baseline: 27,578,719.75 ops/s | 0.00 ops/s (0.00%) | 27,854,506.95 ops/s (125.59%) |
hello-world | Latency nanoseconds (ns) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 54.01 ns(-2.51%)Baseline: 55.40 ns | 54.85 ns (101.55%) | 110.81 ns (48.75%) |
hello-world | Throughput operations / second (ops/s) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 18,471,275.47 ops/s(+3.25%)Baseline: 17,889,450.26 ops/s | 0.00 ops/s (0.00%) | 18,068,344.76 ops/s (102.23%) |
manually-exported-noop | Latency nanoseconds (ns) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 28.15 ns(-3.36%)Baseline: 29.13 ns | 28.84 ns (102.45%) | 58.26 ns (48.32%) |
manually-exported-noop | Throughput operations / second (ops/s) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 34,707,426.02 ops/s(+2.21%)Baseline: 33,958,166.60 ops/s | 0.00 ops/s (0.00%) | 34,297,748.27 ops/s (101.19%) |
Click to view all benchmark results
Benchmark | Latency | Benchmark Result nanoseconds (ns) (Result Δ%) | Lower Boundary nanoseconds (ns) (Limit %) | Upper Boundary nanoseconds (ns) (Limit %) | Throughput | Benchmark Result operations / second (ops/s) (Result Δ%) | Lower Boundary operations / second (ops/s) (Limit %) | Upper Boundary operations / second (ops/s) (Limit %) |
---|---|---|---|---|---|---|---|---|
JsFunction::bind | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 198.67 ns(-5.78%)Baseline: 210.86 ns | 208.75 ns (105.07%) | 421.73 ns (47.11%) | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 4,914,643.21 ops/s(+4.69%)Baseline: 4,694,405.32 ops/s | 0.00 ops/s (0.00%) | 4,741,349.37 ops/s (103.65%) |
JsFunction::call | 📈 view plot 🚷 view threshold | 226.99 ns(+0.63%)Baseline: 225.57 ns | 223.31 ns (98.38%) | 451.14 ns (50.32%) | 📈 view plot 🚷 view threshold | 4,402,536.07 ops/s(-0.65%)Baseline: 4,431,529.03 ops/s | 0.00 ops/s (0.00%) | 4,475,844.32 ops/s (98.36%) |
JsFunction::call_with | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 202.07 ns(-3.39%)Baseline: 209.17 ns | 207.07 ns (102.48%) | 418.33 ns (48.30%) | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 4,861,292.81 ops/s(+2.69%)Baseline: 4,733,974.83 ops/s | 0.00 ops/s (0.00%) | 4,781,314.58 ops/s (101.67%) |
auto-exported-noop | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 28.04 ns(-27.32%)Baseline: 38.58 ns | 38.20 ns (136.22%) | 77.16 ns (36.34%) | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 34,981,675.55 ops/s(+26.84%)Baseline: 27,578,719.75 ops/s | 0.00 ops/s (0.00%) | 27,854,506.95 ops/s (125.59%) |
hello-world | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 54.01 ns(-2.51%)Baseline: 55.40 ns | 54.85 ns (101.55%) | 110.81 ns (48.75%) | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 18,471,275.47 ops/s(+3.25%)Baseline: 17,889,450.26 ops/s | 0.00 ops/s (0.00%) | 18,068,344.76 ops/s (102.23%) |
manually-exported-noop | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 28.15 ns(-3.36%)Baseline: 29.13 ns | 28.84 ns (102.45%) | 58.26 ns (48.32%) | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 34,707,426.02 ops/s(+2.21%)Baseline: 33,958,166.60 ops/s | 0.00 ops/s (0.00%) | 34,297,748.27 ops/s (101.19%) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A blanket impl was added to avoid duplicate methods or a confusing
let (n,) = cx.args()?;
syntax for unary functions. However, this does not work well with the#[neon::export]
macro where functions with zero arguments end up unnecessarily deserializingundefined
.Removing the blanket
impl
and replacing it with a specialized version for()
allows the proc macros to be more efficient without unneeded complexity.In order to make these changes more ergonomic, I added
Context::arg
andContext::arg_opt
for unary functions.Attention: This is a breaking change, but the API has not landed in a stable version yet.
In the future, we could unify these APIs if Rust ships specialization.