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

[FLINK-30471][network] Optimize the enriching network memory process in SsgNetworkMemoryCalculationUtils #21612

Closed
wants to merge 1 commit into from

Conversation

TanYuxin-tyx
Copy link
Contributor

@TanYuxin-tyx TanYuxin-tyx commented Jan 6, 2023

What is the purpose of the change

In SsgNetworkMemoryCalculationUtils#enrichNetworkMemory, getting PartitionTypes is run in a separate loop, which is not friendly to performance. If we want to add inputPartitionTypes in the subsequential PR, a new separate loop may be introduced too, which I think is not a good choice.

Using a separate loop to get each collection just looks simpler in code style, but it will affect the performance. We can get all the results of maxSubpartitionNums and partitionTypes through one loop instead of multiple loops, which will be faster. In this way, when we need to add inputPartitionTypes later, we do not need to add a new loop logic.

Brief change log

  • Get results of maxSubpartitionNums and partitionTypes in one loop instead of two loops.

Verifying this change

This change is already covered by existing tests, such as SsgNetworkMemoryCalculationUtilsTest#testGenerateEnrichedResourceProfileForDynamicGraph and SsgNetworkMemoryCalculationUtilsTest#testGenerateEnrichedResourceProfile.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 6, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@TanYuxin-tyx
Copy link
Contributor Author

The pr is reviewed at #21620.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants