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

[Xamarin.Android.Build.Tasks] leave classes.zip uncompressed #2140

Merged
merged 1 commit into from
Sep 5, 2018

Conversation

jonathanpeppers
Copy link
Member

I was thinking about a couple of the slower MSBuild tasks:

  • Javac
  • CompileToDalvik

One thing I noticed here was that Javac outputs a classes.zip
file, and CompileToDalvik consumes it. It also looked like we are
using CompressionMethod.Default as you would expect.

So why should we compress this file at all? It seemed that was work we
could just skip and things would work fine? Presumably dx.jar can
work with an uncompressed classes.zip file faster than a compressed
one?

So I made the following changes:

  • Added an option to pass in the CompressionMethod in ZipArchiveEx
  • Used CompressionMethod.Store for creating classes.zip

The results on a File | New Xamarin.Forms app looked great!

Before:

 3443 ms  Javac                                      1 calls
11545 ms  CompileToDalvik                            1 calls

After:

 3338 ms  Javac                                      1 calls
10535 ms  CompileToDalvik                            1 calls

I did a Clean before running the SignAndroidPackage target on
these builds.

These savings seem pretty good! The only drawback being we use more
disk space in $(IntermediateOutputPath).

I was thinking about a couple of the slower MSBuild tasks:
- `Javac`
- `CompileToDalvik`

One thing I noticed here was that `Javac` outputs a `classes.zip`
file, and `CompileToDalvik` consumes it. It also looked like we are
using `CompressionMethod.Default` as you would expect.

So why should we compress this file at all? It seemed that was work we
could just skip and things would work fine? Presumably `dx.jar` can
work with an uncompressed `classes.zip` file faster than a compressed
one?

So I made the following changes:
- Added an option to pass in the `CompressionMethod` in `ZipArchiveEx`
- Used `CompressionMethod.Store` for creating `classes.zip`

The results on a File | New Xamarin.Forms app looked great!

Before:

     3443 ms  Javac                                      1 calls
    11545 ms  CompileToDalvik                            1 calls

After:

     3338 ms  Javac                                      1 calls
    10535 ms  CompileToDalvik                            1 calls

I did a `Clean` before running the `SignAndroidPackage` target on
these builds.

These savings seem pretty good! The only drawback being we use more
disk space in `$(IntermediateOutputPath)`.
@jonathanpeppers
Copy link
Member Author

Build logs here: ClassesZipUncompressed.zip

@dellis1972 dellis1972 merged commit 84f928c into dotnet:master Sep 5, 2018
jonpryor pushed a commit that referenced this pull request Sep 5, 2018
I was thinking about a couple of the slower MSBuild tasks:
- `Javac`
- `CompileToDalvik`

One thing I noticed here was that `Javac` outputs a `classes.zip`
file, and `CompileToDalvik` consumes it. It also looked like we are
using `CompressionMethod.Default` as you would expect.

So why should we compress this file at all? It seemed that was work we
could just skip and things would work fine? Presumably `dx.jar` can
work with an uncompressed `classes.zip` file faster than a compressed
one?

So I made the following changes:
- Added an option to pass in the `CompressionMethod` in `ZipArchiveEx`
- Used `CompressionMethod.Store` for creating `classes.zip`

The results on a File | New Xamarin.Forms app looked great!

Before:

     3443 ms  Javac                                      1 calls
    11545 ms  CompileToDalvik                            1 calls

After:

     3338 ms  Javac                                      1 calls
    10535 ms  CompileToDalvik                            1 calls

I did a `Clean` before running the `SignAndroidPackage` target on
these builds.

These savings seem pretty good! The only drawback being we use more
disk space in `$(IntermediateOutputPath)`.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants