-
Notifications
You must be signed in to change notification settings - Fork 288
feat(neon): Export LazyLock globals #1111
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
Conversation
|
Branch | kv/lazylock |
Testbed | ubuntu-latest |
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 | 243.91 ns(+17.58%)Baseline: 207.44 ns | 186.70 ns (76.54%) | 414.89 ns (58.79%) | 📈 view plot 🚷 view threshold | 4,108,574.90 ops/s(-14.55%)Baseline: 4,808,028.76 ops/s | 0.00 ops/s (0.00%) | 5,288,831.64 ops/s (77.68%) |
JsFunction::call | 📈 view plot 🚷 view threshold | 223.49 ns(+2.18%)Baseline: 218.73 ns | 196.86 ns (88.08%) | 437.46 ns (51.09%) | 📈 view plot 🚷 view threshold | 4,459,983.96 ops/s(-2.03%)Baseline: 4,552,206.20 ops/s | 0.00 ops/s (0.00%) | 5,007,426.82 ops/s (89.07%) |
JsFunction::call_with | 📈 view plot 🚷 view threshold | 192.83 ns(-6.49%)Baseline: 206.23 ns | 185.60 ns (96.25%) | 412.45 ns (46.75%) | 📈 view plot 🚷 view threshold | 5,176,853.28 ops/s(+6.78%)Baseline: 4,848,148.80 ops/s | 0.00 ops/s (0.00%) | 5,332,963.68 ops/s (97.07%) |
auto-exported-noop | 📈 view plot 🚷 view threshold | 27.83 ns(-9.14%)Baseline: 30.63 ns | 27.57 ns (99.05%) | 61.26 ns (45.43%) | 📈 view plot 🚷 view threshold | 35,658,727.42 ops/s(+6.83%)Baseline: 33,379,784.97 ops/s | 0.00 ops/s (0.00%) | 36,717,763.46 ops/s (97.12%) |
hello-world | 📈 view plot 🚷 view threshold | 58.28 ns(+1.55%)Baseline: 57.39 ns | 51.65 ns (88.63%) | 114.78 ns (50.77%) | 📈 view plot 🚷 view threshold | 17,193,747.26 ops/s(-1.12%)Baseline: 17,389,221.97 ops/s | 0.00 ops/s (0.00%) | 19,128,144.16 ops/s (89.89%) |
manually-exported-noop | 📈 view plot 🚷 view threshold | 27.85 ns(-1.95%)Baseline: 28.40 ns | 25.56 ns (91.79%) | 56.80 ns (49.03%) | 📈 view plot 🚷 view threshold | 35,916,651.55 ops/s(+2.17%)Baseline: 35,155,384.45 ops/s | 0.00 ops/s (0.00%) | 38,670,922.90 ops/s (92.88%) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1111 +/- ##
==========================================
- Coverage 84.34% 82.85% -1.50%
==========================================
Files 74 74
Lines 5578 4701 -877
Branches 5578 4701 -877
==========================================
- Hits 4705 3895 -810
+ Misses 767 713 -54
+ Partials 106 93 -13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just needs one comment, but otherwise 🚢
This changes the macro to call
try_into_js
on a reference and leverage autoref specialization and autoderef to make it work. Since the macro only works onstatic
andconst
, it already only worked onCopy
types which continues to work.This makes it more flexible so that you can also export types where their reference implements
TryIntoJs
. I also added aTryIntoJs
implementation forLazyLock<T>
where&T: TryIntoJs
. It only makes sense to implement it for a reference since getting an owned value would require clone.The combination of these features allows you to export things like
LazyLock<Vec<u8>>
.