Skip to content

[Core][Benchmark] Add benchmarks for Table GetValue and GetDerivative #13497

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

loumalouomega
Copy link
Member

📝 Description

This PR introduces performance benchmarks for the Table::GetValue and Table::GetDerivative methods.

The benchmarks are designed to measure the performance of these functions across various table sizes: 5, 10, 20, 200, 2000, and 20000 elements.

For each test:

  • A Table<double, double> is populated with sorted data, where X values are i*0.1 and Y values include a small sinusoidal variation.
  • A number of lookup X values (5 times the table size) are generated. These lookup values are distributed such that 20% are below the table's minimum X value, 20% are above the table's maximum X value, and the remaining 60% are within the table's X range. This aims to test edge cases and typical usage.
  • The GetValue or GetDerivative method is called repeatedly with these lookup values.
  • volatile is used for the sum of results to prevent the compiler from optimizing away the core lookup operations.

These benchmarks will help in monitoring and improving the performance characteristics of the Table class. (My experiments have been futile, but the benchmark is OK)

🆕 Changelog

@loumalouomega loumalouomega requested a review from a team as a code owner June 5, 2025 18:17
@loumalouomega loumalouomega added the FastPR This Pr is simple and / or has been already tested and the revision should be fast label Jun 5, 2025
@loumalouomega loumalouomega enabled auto-merge June 5, 2025 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Benchmarking FastPR This Pr is simple and / or has been already tested and the revision should be fast Kratos Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant