-
Notifications
You must be signed in to change notification settings - Fork 12
Make bench-canister use a better Bench type #371
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
Conversation
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.
rvanasa
left a comment
There was a problem hiding this 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.
|
Please approve workflows again |
|
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. |
|
Thanks for looking into it. I'm just going to merge expecting that it's related to the PR originating from a fork. |
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
benchpackage. This makes sense because the purpose of thebenchpackage 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 thebenchpackage is theBenchSchematype. 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.