-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add a benchmark executable #79
base: main
Are you sure you want to change the base?
Conversation
Joannis
commented
Jul 7, 2023
•
edited
Loading
edited
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.
2 small first notes
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.
Two questions...
…ing errors when unwrapping the value
996b843
to
4f6ae6f
Compare
], | ||
dependencies: [ | ||
.package(path: "../"), | ||
.package(url: "https://github.com/ordo-one/package-benchmark.git", exact: "1.11.1"), |
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.
I'd suggest to use from:
, or at least bump to a recent version (.e.g, 1.18.0
) - 1.11.1
is quite old by now and NIO has from
rather than exact
.
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.
I realised this too, but had an issue with the latest build. I don't remember what it was, I believe my SPM caches were broken
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.
Ok, @Joannis let me know if you have any issues with the package itself, 1.20 just released with quite a few fixes visavi 1.11.
let resp3ArrayValueBuffer = ByteBuffer(string: "*2\r\n$3\r\nGET\r\n$7\r\nwelcome\r\n") | ||
let resp3ArrayCount = 2 | ||
|
||
Benchmark("RESP3 Array Parsing") { benchmark in |
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.
Benchmark("RESP3 Array Parsing") { benchmark in | |
Benchmark("RESP3 Array Parsing", configuration: .init(scalingFactor: .kilo)) { benchmark in | |
for _ in benchmark.scaledIterations { | |
try runRESP3ArrayParsing( | |
valueBuffer: resp3ArrayValueBuffer, | |
valueCount: resp3ArrayCount | |
) | |
} |
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.
Would suggest using such scaling factor (.kilo) for the RESP Array Parsing
and RESP3 Array Parsing
benchmarks, as they have very short runtimes. The scaling factor is used as an inner loop and the results will be scaled up accordingly for throughput if you update to a recent benchmark version.