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

meta: Add a small benchmark suite to sentry-core #306

Merged
merged 1 commit into from
Jan 8, 2021
Merged

Conversation

Swatinem
Copy link
Member

@Swatinem Swatinem commented Jan 7, 2021

The benchmarks so far test the scope with tags and breadcrumbs in a few
situations:

  • inactive client,
  • active client, only scope manipulation
  • active client, scope and capturing messages

The Benchmarks also allow measuring the "minimal API" mode, which
basically removes the complete implementation at compile time.

Measurements on my system are:

Minimal API (compile-time noop): ~2.6ns

Tags:

  • inactive: 66ns
  • active: 26us
  • capture: 53us

Breadcrumbs:

  • inactive: 2us
  • active: 52us
  • capture: 88us

The benchmarks so far test the scope with tags and breadcrumbs in a few
situations:
* inactive client,
* active client, only scope manipulation
* active client, scope and capturing messages

The Benchmarks also allow measuring the "minimal API" mode, which
basically removes the complete implementation at compile time.

Measurements on my system are:

Minimal API (compile-time noop): ~2.6ns

Tags:
* inactive: 66ns
* active: 26us
* capture: 53us

Breadcrumbs:
* inactive: 2us
* active: 52us
* capture: 88us

let client = Arc::new(sentry::Client::from(sentry::ClientOptions {
dsn: Some("https://public@sentry.invalid/1".parse().unwrap()),
// lol, this double arcing -_-
Copy link
Contributor

Choose a reason for hiding this comment

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

lol, how did that happen?

Copy link
Member Author

Choose a reason for hiding this comment

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

The first is impl TransportFactory for Arc<Transport>, the second one is because clientoptions takes an Arc<dyn TransportFactory> explicitly :-(

@Swatinem Swatinem merged commit f30a7d2 into master Jan 8, 2021
@Swatinem Swatinem deleted the meta/bench branch January 8, 2021 09:30
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.

2 participants