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

Adds benchmarks for insertion/operations/lookup #90

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

xfbs
Copy link
Contributor

@xfbs xfbs commented Feb 5, 2024

This PR add benchmarks for insertion, operations and lookups. For now, I have only implemented them for the map types, my reasoning being that the set types are rather small wrappers around those and as such, measuring the performance of the map types should be sufficient.

The benchmarks are configurable using constants. You can set these to different values and observe how the code performs. The available constants are:

  • Key: key types being used
  • Value: value types being used
  • COUNT: count for the insertions
  • OPERATIONS: number of operations
  • LOOKUPS: number of lookups

The benchmark is also set to calculate throughput, such as to have a better understanding of the the times mean. Note that the rangemap likely scales O(n log n), so that changing the insertions/operations/lookups affects the measured throughput (in other words, the throughput does not stay constant).

I have used proptest to generate the input sets here, simply because it is convenient.

Screenshot 2024-02-05 at 13 59 06

@xfbs xfbs marked this pull request as ready for review February 5, 2024 12:59
@xfbs xfbs mentioned this pull request Feb 5, 2024
Copy link
Owner

@jeffparsons jeffparsons left a comment

Choose a reason for hiding this comment

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

🚀

@jeffparsons jeffparsons merged commit 2cc8ce9 into jeffparsons:main Feb 7, 2024
13 checks passed
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