KEMBAR78
chore(benchmarks): Add in optional warmup to benchmarks by sydney-munro · Pull Request #2359 · googleapis/java-storage · GitHub
Skip to content

Conversation

@sydney-munro
Copy link
Contributor

No description provided.

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/java-storage API. labels Jan 16, 2024
Copy link

@BrennaEpp BrennaEpp left a comment

Choose a reason for hiding this comment

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

Some initial comments, though I know this is still in draft so I know you may be aware of these already.

@sydney-munro sydney-munro changed the title chore(benchmarks): Add in 15s warmup to benchmarks chore(benchmarks): Add in optional warmup to benchmarks Jan 16, 2024
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

Couple comments, overall looks good to me. Thanks for your work getting this going.

description = "Specify the path where the temporary directory should be located")
String tempDirLocation;

@Option(names = "-warmup", description = "Warmup in seconds", defaultValue = "0")
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe be a little more specific about what this means.

long startTime = System.currentTimeMillis();
long endTime = startTime + (warmup * 1000);
// Run Warmup
while (System.currentTimeMillis() < endTime) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems perhaps a little confusing to have this as just a few lines within W1R3 rather than as a separate method. Not a java expert here but maybe it's better to factor this out for ease of readability and/or sharing with other workloads?

Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

Overall LGTM aside from the open question about number of workers. You might also want to get a review from @frankyn on Java.

Copy link
Contributor

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

@sydney-munro, from our offline conversation, this PR is not yet ready, so some of my comment may not be relevant after the change is verified to work and is cleaned up.

I'll re-review once ready, but overall LGTM.

@sydney-munro sydney-munro requested a review from frankyn January 22, 2024 23:21
@sydney-munro sydney-munro marked this pull request as ready for review January 22, 2024 23:22
@sydney-munro sydney-munro requested a review from a team as a code owner January 22, 2024 23:22
@sydney-munro sydney-munro added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 23, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 23, 2024
@sydney-munro sydney-munro requested a review from a team as a code owner January 23, 2024 18:55
@sydney-munro sydney-munro added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 23, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 23, 2024
@sydney-munro sydney-munro merged commit f88bcf8 into main Jan 23, 2024
@sydney-munro sydney-munro deleted the warmup branch January 23, 2024 21:45
Copy link

@BrennaEpp BrennaEpp left a comment

Choose a reason for hiding this comment

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

Thanks Sydney, a couple questions.

List<ApiFuture<String>> workloadRuns = new ArrayList<>();
Range objectSizeRange = Range.of(objectSize);
for (int i = 0; i < samples; i++) {
runWarmup(storageClient);

Choose a reason for hiding this comment

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

This is interesting - so if you request 5 samples, it will run the warmup for every sample?

For SSB I guess it doesn't matter, because we only request one sample (unless it were server mode, which would require other changes too and we're not sure is needed yet for Java). But in general, I would expect the application only need to warm up once in the beginning, unless there are some specifics of the Java implementation I'm not aware of?

Copy link
Contributor

Choose a reason for hiding this comment

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

I missed this; good catch. This line needs to be moved out of the loop;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was told when syncing with @tritone that a warmup was expected for every datapoint. am I mistaken?

Choose a reason for hiding this comment

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

Hm, it just occurred to me that on a single threaded benchmark, the connections for the later data points may be in fact less warmed than the first ones, since the warmups are done with multiple threads. But, that applies in Go, not sure for Java. The effect may also be negligible within a certain time frame.

For consistency and because we aren't sure the effect of the warmups yet in Java, I'd say move this line out of the loop. It's easier to test with the line outside of the loop, since it's not multiplying the warmup period by the number of the sample.

For SSB workload 1, yes, every data point needs to be warmed but that's because every data point runs on a fresh client. In this case the client is used across samples so it's already warmed up. Outside of the single (or perhaps low) threaded benchmarks, spending more time warming is not necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the googleapis/java-storage API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants