-
Notifications
You must be signed in to change notification settings - Fork 311
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
feat: reduce package file size #1730
Conversation
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
I could really use this. I am only using 1 Google service and I am using an NFS mounted filesystem that is shared between my web servers. Sometimes when installing an updated version of this package I run into a timeout because it takes so long to write all these small files. I know that is not your problem but reducing the size and number of files would be beneficial to many people. |
Hello @ejunker ! Please test using this branch (you can do so by running |
Here are some benchmarks I did: I ended up creating my own fork of the package with only the files I need. When I install that package it only takes 2 seconds! This is what my composer.json looks like: "require": {
"google/apiclient-services": "dev-main as v0.292.0"
},
"repositories": [
{
"type": "vcs",
"url": "git@github.com:ejunker/google-indexing.git"
}
] I think I will continue to use my custom fork but it is encouraging to see it drop from 6 minutes down to 1 minute. |
Have you ever thought about creating read-only subtree splits and publishing multiple packages? Many of the PHP frameworks like Laravel and Symfony do this. https://tomasvotruba.com/blog/2017/01/31/how-monolithic-repository-in-open-source-saved-my-laziness/ |
We have thought of it but 250+ new repos for a no longer truly maintained
library is not something we can realistically do at the moment. We already
do that for our new client libraries here:
https://cloud.google.com/php/docs/reference
…On Tue, Apr 4, 2023, 4:50 PM Eric Junker ***@***.***> wrote:
Have you ever thought about creating read-only subtree splits and
publishing multiple packages? Many of the PHP frameworks like Laravel and
Symfony do this.
https://tomasvotruba.com/blog/2017/01/31/how-monolithic-repository-in-open-source-saved-my-laziness/
—
Reply to this email directly, view it on GitHub
<#1730 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZMBMCRCJ5IMFQSWJZGNLW7SJTJANCNFSM6AAAAAASHFDGOE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Reduces the package file size by doing the following:
model.php
Testing on the branch consolidate-models-gen, with just these two changes, we get a reduction of 99M to 44M:
$ composer require google/apiclient-services Using version ^0.275.0 for google/apiclient-services $ du -sh vendor/google/apiclient-services 99M vendor/google/apiclient-services $ composer require google/apiclient-services:dev-consolidate-models-gen $ du -sh vendor/google/apiclient-services 44M vendor/google/apiclient-services
That's a reduction of 56% file size (55MB)!!
TODO: Verify what composer pulls down and check the size there
NOTE: My testing removed
RemoteBuildExecution
,SemanticTile
,AdExchangeBuyer
,Webmasters
, andPlayableLocations
Other consideration
protected $xyzDataType = ''
, don't create the property, as it's functionally equivalent to the property not existing (see Model::__get).class_alias
calls (they've been around for a year and a half now)Other OTHER considerations (not related to package file size)
googlemirror/apiclient-mybusinessqa
)