Skip to content

Conversation

@mflatt
Copy link
Contributor

@mflatt mflatt commented Sep 22, 2025

The black-box function takes one argument and returns it, but optimization knows only that black-box returns a single value. This makes black-box useful for some testing and benchmarking tasks.

The `black-box` function takes one argument and returns it, but
optimization knows only that `black-box` returns a single value. This
makes `black-box` useful for some testing and benchmarking tasks.
Copy link
Contributor

@burgerrg burgerrg left a comment

Choose a reason for hiding this comment

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

Thanks for this helpful procedure!

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using much smaller loop sizes to keep the test time down.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for looking it over! I worry about making the number of iterations too small to measure reliably. The current 1000 iterations is meant to provoke allocation on the order of a page, and the slowest variant takes sub-milliscond time on my machine.

Copy link
Contributor

@burgerrg burgerrg left a comment

Choose a reason for hiding this comment

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

Since the tests take less than 1 ms, there's no need to risk doing less allocation.

@mflatt mflatt merged commit dcf1266 into cisco:main Sep 23, 2025
16 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.

3 participants