Skip to content
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

[Dataflow Streaming] Optimizing work submit loop #33736

Merged
merged 4 commits into from
Jan 24, 2025

Conversation

arunpandianp
Copy link
Contributor

@arunpandianp arunpandianp commented Jan 23, 2025

  1. Moving recordGetWorkStreamLatencies to run outside work submission loop
  2. Change OutputReceiver::outputCounters from HashMap to LinkedHashmap

#33578

@@ -88,7 +87,7 @@ private Work(
this.watermarks = watermarks;
this.clock = clock;
this.startTime = clock.get();
this.totalDurationPerState = new EnumMap<>(LatencyAttribution.State.class);
this.totalDurationPerState = new HashMap<>();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

EnumMap is constructing a keyUniverse array in the constructor which shows up in profiles, replacing it with hashmap to speed up work submit loop.
Screenshot 2025-01-22 at 9 00 34 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

Another idea where the map would still be stored as an array without hashing is to have an empty static EnumMap that you construct the new map referencing. Then it wouldn't have to recalculate the key universe

@arunpandianp
Copy link
Contributor Author

R: @scwhittle

Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@arunpandianp
Copy link
Contributor Author

Run Java PreCommit

1 similar comment
@arunpandianp
Copy link
Contributor Author

Run Java PreCommit

@@ -88,7 +87,7 @@ private Work(
this.watermarks = watermarks;
this.clock = clock;
this.startTime = clock.get();
this.totalDurationPerState = new EnumMap<>(LatencyAttribution.State.class);
this.totalDurationPerState = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Another idea where the map would still be stored as an array without hashing is to have an empty static EnumMap that you construct the new map referencing. Then it wouldn't have to recalculate the key universe

@arunpandianp
Copy link
Contributor Author

arunpandianp commented Jan 24, 2025

Another idea where the map would still be stored as an array without hashing is to have an empty static EnumMap that you construct the new map referencing. Then it wouldn't have to recalculate the key universe

Done.

@scwhittle
Copy link
Contributor

failure appears unrelated

@scwhittle scwhittle merged commit b8bd935 into apache:master Jan 24, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants