Skip to content

Conversation

@timohanke
Copy link
Contributor

@timohanke timohanke commented Jan 25, 2026

The bench-canister previously expected a type for the Bench passed in by the user that was too narrow. The expected type included public setter functions in Bench even though the bench-canister does not call setter functions. Therefore it was making an assumption about implementation details of Bench on the user's side. That was unnecessary and restrictive.

This commit changes the expected type to a suitable supertype which only includes the getter functions that are actually used by the bench-canister. Plus, it also expects the currently still unused getVersion getter because that one is likely to be used in the future.

bench-canister no longer imports the bench package. This makes sense because the purpose of the bench package is as a helper to the user to write Benches. It chooses one specific implementation of Benches, something that is irrelevant to the bench-canister. The only duplicated code between bench-canister and the bench package is the BenchSchema type. Still, this duplication makes sense because bench-canister defines what it needs and the package re-implements the type on the user side for convenience to the user.

The bench-canister previously expected a type for the Bench passed
in by the user that was too narrow. The expected type included
public setter functions in Bench. Therefore it was making an
assumption about implementation details of Bench on the user's
side. That was unnecessary and restrictive.

This commit changes the expected to a suitable supertype which
only expects the getter functions that are actually used by the
bench-canister. Plus it also expects the currently still unused
getVersion getter, but which is likely to be used in the future.

bench-canister no longer imports the `bench` package. This makes
sense because the purpose the `bench` package is as a helper to
the user to write Benches. The only duplicated code between
bench-canister and the `bench` package is the BenchSchema type.
Still, this duplication makes sense because bench-canister
defines what it needs and the package re-implements the type on
the user side for convenience to the user.
@timohanke timohanke requested a review from a team as a code owner January 25, 2026 18:15
rvanasa
rvanasa previously approved these changes Jan 26, 2026
Copy link
Contributor

@rvanasa rvanasa left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for this simplification of how benchmarking works for Mops.

@timohanke
Copy link
Contributor Author

Please approve workflows again

rvanasa
rvanasa previously approved these changes Jan 26, 2026
@timohanke
Copy link
Contributor Author

timohanke commented Jan 26, 2026

Next try, please approve workflows again.

I don't know what goes wrong in "Run benchmark and comment" in step "Create or Update Comment" though. That might still not work.

@rvanasa
Copy link
Contributor

rvanasa commented Jan 27, 2026

Thanks for looking into it. I'm just going to merge expecting that it's related to the PR originating from a fork.

@rvanasa rvanasa merged commit 98f8b49 into caffeinelabs:main Jan 27, 2026
16 of 17 checks passed
@timohanke timohanke deleted the bench-canister branch January 27, 2026 16:15
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