-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce number of reductions in Appsignal.Instrumentation.instrument/3 (…
…#855) * Remove calls to Config.active?/0 from Span Currently, the Config.active?/0 function is called every time Span.set_name/2 or Span.do_add_error/4 functions are called. Because calling either of these functions on a nil is a noop, and nils are passed around instead of spans when the package is not active, these can be safely removed. This reduces the amount of ets lookups by 2n when calling the instrument/3 function with a name and a category. * Pass fetched config from active?/0 to valid?/1 Currently, the Config.active?/0 function calls out to valid?/0 if the configuration is marked as active. Both functions fetch the configuration, which requires an ets lookup. Calling the valid?/1 function from active?/0 while passing the already-fetched configuration saves the second lookup. * Run lookups without checking the registry first Currently, each lookup is preceded by a check if the registry is running. This patch removes that check and adds error handling for doing lookups when the registry is not running. * Remove running?/0 checks before insert or delete Much like checking to see if the registry was running before every lookup, the current version checks if the registry is running before every insertion or deletion. Instead, this patch handles errors caused by the registry being down. * Handle nil timestamps in span creation functions Instead of checking if a timestamp is present, pass whatever's passed as a timestamp in the options keyword list and have the Span.create_root/3 and Span.create_child/3 functions handle calls with or without timestamps. * Add changeset to describe tracer performance fixes "Improve Tracer performance by removing duplicate runtime configuration and storage checks"
- Loading branch information
1 parent
197fb38
commit af40211
Showing
5 changed files
with
95 additions
and
142 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...r-performance-by-removing-duplicate-runtime-configuration-and-storage-checks.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
bump: "patch" | ||
type: "fix" | ||
--- | ||
|
||
Improve Tracer performance by removing duplicate runtime configuration and storage checks |
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
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
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
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