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 — perf: collisions don't contain reserved names by default by software-dov · Pull Request #684 · googleapis/gapic-generator-python

This repository was archived by the owner on Aug 25, 2026. It is now read-only.

Conversation

@software-dov

@software-dov software-dov commented Oct 23, 2020 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

The 'collisions' set does NOT contain RESERVED_NAMES; they are
combined at runtime when needed.

For a large real-world, this results in an order of magnitude
reduction in memory usage.
I'm not joking: Google Ads v5 uses 2.45 GB peak before this change
and 223 MB after.

Also contains changes to add __slots__ attributes to Metadata and Address. These are ancillary, optional, and open to negotiation.
In the above scenario, they reduce memory usage from 223 MB to 177 MB. If other people feel that the reduction in readability does not warrant the reduction in memory usage I am absolutely open to dropping that particular commit.

Includes other minor memory usage optimizations that collectively shave about 5 MB.

Sorry, something went wrong.

Uh oh!

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

busunkim96 reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@software-dov
perf: collisions don't contain reserved names by default
e3ebc7f
The 'collisions' set does NOT contain RESERVED_NAMES; they are
combined at runtime when needed.

For a large real-world, this results in an order of magnitude
reduction in memory usage.
I'm not joking: Google Ads v5 uses 2.45 GB before this change
and 223 MB after.
@software-dov
software-dov requested review from a team, busunkim96, crwilcox, lukesneeringer, vchudnov-g and xiaozhenliu-gg5 October 23, 2020 21:49
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 23, 2020
@codecov

codecov Bot commented Oct 23, 2020 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Codecov Report

Merging #684 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #684   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines         1561      1560    -1     
  Branches       315       316    +1     
=========================================
- Hits          1561      1560    -1     
Impacted Files Coverage Δ
gapic/schema/metadata.py 100.00% <100.00%> (ø)
gapic/schema/wrappers.py 100.00% <100.00%> (ø)

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 18425e2...6821a97. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

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

busunkim96
busunkim96 approved these changes Oct 27, 2020
View reviewed changes

@busunkim96 busunkim96 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.

Also contains changes to add slots attributes to Metadata and Address. These are ancillary, optional, and open to negotiation.
In the above scenario, they reduce memory usage from 223 MB to 177 MB. If other people feel that the reduction in readability does not warrant the reduction in memory usage I am absolutely open to dropping that particular commit.

I would personally prefer preserving readability.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread gapic/schema/metadata.py Outdated
Comment on lines +151 to +152
# Don't keep RESERVED_NAMES in self.collisions,
# just combine the two when necessary.

@busunkim96 busunkim96 Oct 27, 2020

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.

Perhaps add a note that this is for memory usage?

Sorry, something went wrong.

Uh oh!

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

All reactions
@noahdietz @software-dov
chore: update actools-python perm in sync settings (googleapis#683)
50c4dcd
@software-dov
software-dov force-pushed the collisions branch from 9e25710 to 50c4dcd Compare October 27, 2020 17:18
@software-dov software-dov added the automerge Merge the pull request once unit tests and other checks pass. label Oct 27, 2020
@software-dov
Merge branch 'master' into collisions
6821a97
@gcf-merge-on-green
gcf-merge-on-green Bot merged commit 2ec6ea6 into googleapis:master Oct 27, 2020
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Oct 27, 2020
gcf-merge-on-green Bot pushed a commit that referenced this pull request Oct 27, 2020
@release-please
chore: release 0.35.9 (#686)
225ba19
🤖 I have created a release \*beep\* \*boop\* 
---
### [0.35.9](https://www.github.com/googleapis/gapic-generator-python/compare/v0.35.8...v0.35.9) (2020-10-27)


### Performance Improvements

* collisions don't contain reserved names by default ([#684](https://www.github.com/googleapis/gapic-generator-python/issues/684)) ([2ec6ea6](https://www.github.com/googleapis/gapic-generator-python/commit/2ec6ea6835256c0d7b252e035cf4eac1ff442647))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
This was referenced Jan 18, 2022
chore(master): release reverted #1133
Merged
chore(master): release 0.39.1 #1146
Closed
This was referenced Jan 26, 2022
chore(main): release 0.39.1 #1160
Closed
chore(main): release 0.39.1 #1162
Closed
chore(main): release 0.61.0 #1163
Merged
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@lukesneeringer lukesneeringer Awaiting requested review from lukesneeringer
@crwilcox crwilcox Awaiting requested review from crwilcox
@vchudnov-g vchudnov-g Awaiting requested review from vchudnov-g
@xiaozhenliu-gg5 xiaozhenliu-gg5 Awaiting requested review from xiaozhenliu-gg5
1 more reviewer
@busunkim96 busunkim96 busunkim96 approved these changes
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

cla: yes This human has signed the Contributor License Agreement.

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.

3 participants

@software-dov @busunkim96 @noahdietz
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.