GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — DON'T MERGE: Add some preliminary Batching benchmarks. by igorbernstein2 · Pull Request #486 · googleapis/gax-java

This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Conversation

@igorbernstein2

@igorbernstein2 igorbernstein2 commented Feb 23, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

I'm starting to work on bigtable batching, which will need flushing support. Which (I think) will entail exposing a lower level api. I think that ThresholdBatchers (or something in the same spirit) will have be exposed. After reading @pongad's exploration in googleapis/google-cloud-java#2910, I wanted to write some benchmarks to identify the bottlenecks he found and to gain a better understanding of the existing batching infrastructure.

Preliminary analysis seems to indicate that merging individual requests has a high cost associated with it.

I figured I'd post this in hopes it helping @pongad in his efforts with batching for logging

Edit:
I should point out that I'm mainly benchmarking single thread writers using netty over a loopback. I'm also only using element count threshold & flow control to keep the code simple

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@igorbernstein2
Add some preliminary Batching benchmarks.
b169863
@garrettjonesgoogle
garrettjonesgoogle requested a review from pongad February 23, 2018 19:53
@garrettjonesgoogle

garrettjonesgoogle commented Feb 23, 2018

Copy link
Copy Markdown
Contributor

I will defer to @pongad on this one

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@igorbernstein2
copyright
d1151bf
@codecov-io

codecov-io commented Feb 23, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #486 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #486   +/-   ##
=========================================
  Coverage     70.34%   70.34%           
  Complexity      773      773           
=========================================
  Files           162      162           
  Lines          3672     3672           
  Branches        275      275           
=========================================
  Hits           2583     2583           
  Misses          973      973           
  Partials        116      116

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8eda69...077f1bc. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

pongad
pongad reviewed Feb 26, 2018
View reviewed changes

@pongad pongad left a comment

Copy link
Copy Markdown
Contributor

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.

Thank you for working on this? The 20x slow down is a little...disconcerting. Could you teach me how to run a profiler? I tried -Pprofilers=stack but that seems to not be the right incantation.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread benchmark/src/jmh/java/com/google/api/gax/grpc/BatchingBenchmark.java Outdated
requestBuilder.addMessages(
PubsubMessage.newBuilder()
.setData(payloads[RANDOM.nextInt(payloads.length)])
.setMessageId("message-" + i)

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@igorbernstein2

igorbernstein2 commented Feb 26, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Edit build.gradle and add jmh.profilers = ['stack']. All of the config options are described here:
https://github.com/melix/jmh-gradle-plugin#configuration-options

If you find that you are using certain configs often, we can expose them via gradle properties (like include)

PS. I'll update the readme with this info later on today

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

igorbernstein2 added 3 commits March 1, 2018 00:32
@igorbernstein2
approach 1: remove batch merging
4ee6f9d
@igorbernstein2
wip
6b92441
@igorbernstein2
wip
077f1bc
@igorbernstein2

igorbernstein2 commented Mar 1, 2018

Copy link
Copy Markdown
Contributor Author

I hacked together a proof of concept implementation that removes batch merging. entries are accumulated in the ThresholdBatcher and a Batch is only built on pushCurrentBatch().

The results are fairly encouraging:
existing implementation: 24K elements/s (avg)
new implementation: 156K elements/s (avg)

I have a few things to clean up & verify, and then I'll open a separate PR for this change. This is orthogonal to @pongad's work on the RequestAccumulator. My change would just centralize the place where entries are spooled, while @pongad's would extract it to a separate class.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sduskis

sduskis commented Jan 16, 2019

Copy link
Copy Markdown
Contributor

@igorbernstein2, this is an old PR. Can we close it?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@igorbernstein2

igorbernstein2 commented Jan 16, 2019

Copy link
Copy Markdown
Contributor Author

ok, I'll reopen something similar once I get back to work on this

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@igorbernstein2 igorbernstein2 closed this Jan 16, 2019
@igorbernstein2
igorbernstein2 deleted the batching branch November 22, 2021 19:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@pongad pongad pongad left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@igorbernstein2 @garrettjonesgoogle @codecov-io @sduskis @pongad
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.