fix: dead member, capacity checks, insert perf, napi_env by value#27
Merged
Conversation
…pass-by-value - Remove unused `uv_cpu_info_t cpu_stats` member from MeasurementsTicker, initialize local pointer to nullptr in cpu_callback instead - Replace `capacity()` checks in measurement callbacks with a `kMaxMeasurementSamples` constant — capacity can grow past reserve() so the old check was not a reliable cap - Replace `vector::insert(begin() + index)` with `push_back()` in measurement callbacks — insertion is always at the end, push_back is O(1) vs O(n) - Pass `napi_env` by value instead of const reference — it is a pointer typedef, so pass-by-ref adds unnecessary indirection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
timfish
approved these changes
Apr 30, 2026
mydea
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
May 8, 2026
…4.0 (#20720) Bumps this from 2.2.0 to 2.4.0, including the following changes: ## v2.4.0 * feat: Add Node 26 support (getsentry/sentry-javascript-profiling-node-binaries#32) ## v2.3.0 * fix: Memory leaks, integer truncation, UB, and double-stop (getsentry/sentry-javascript-profiling-node-binaries#26) * fix: Integer arithmetic for timestamps, emit elapsed_since_start_ns as string (getsentry/sentry-javascript-profiling-node-binaries#28) * fix: Dead member, capacity checks, insert perf, napi_env by value (getsentry/sentry-javascript-profiling-node-binaries#27) * chore: Replace execSync with execFileSync to prevent command injection (getsentry/sentry-javascript-profiling-node-binaries#23) * chore: Pin GitHub Actions to full-length commit SHAs (getsentry/sentry-javascript-profiling-node-binaries#24) * ci: Build Linux in container for wider glibc support (getsentry/sentry-javascript-profiling-node-binaries#16)
This file contains hidden or 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
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.
Remove cpu stats and improve the accuracy of the capacity checks.