Closed codefromthecrypt closed 11 months ago
ps I ran tests manually, and they pass. after https://github.com/kubernetes-sigs/kube-scheduler-wasm-extension/pull/30 we don't need manual verification
@anuraaga your review is helpful thanks! many things I'm not committed to, and it is helpful to see someone looking!
I should disclose the simple wasm filter grew 9KB over this, but it is 9/876 and probably unanimously worth it
@anuraaga can you take another look and approve or let me know if any glitches left? since this has no formal approvals to lose yet, I snuck in some more godoc and polish.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: anuraaga, codefromthecrypt, sanposhiho
The full list of commands accepted by this bot can be found here.
The pull request process is described here
What type of PR is this?
/kind cleanup /kind api-change
What this PR does / why we need it:
This makes the parameters to filter function more like those in the host by creating a proxy interface. Doing so only slows down the no-op case by some tens of nanoseconds, so it doesn't matter.
The interesting part is if users return nil for status instead of multiple values it is faster. So, this changes signature to return a pointer to status. (I checked against stack based value and it is still faster).
Finally, this optimizes the example, because our test data doesn't actually have podSpecNodeName field. This drop in execution time proves parameters not read are lazy.
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?
NONE because the project isn't usable yet.
What are the benchmark results of this change?
First, changing to new guest signatures
Next, optimizing the filter example