Why is Grpc.Core NuGet package so big?

Viewed 695

The latest Grpc.Core NuGet package is a hefty 150 MB. It seems to have grown steadily over its life. Here are a few examples:

  • v1.17.1 (Dec 2018) 48.34 MB
  • v2.23.1 (Aug 2019) 68.11 MB
  • v2.30.0 (Jun 2020) 150.28 MB

Maybe this is not apples-to-apples, but to pick a random example the Entity Framework Core package is 859 KB.

I'm curious what's in this package that makes it so darn big. Is there perhaps some stuff that is not totally essential for someone who is creating a simple C# service?

1 Answers

The core functionality of the package containing libraries and build scripts totals at less than 2 MB. What makes to package so large is that it contains runtime files for Linux, Windows and Mac OSX, as well as native libraries for iOS and Android. Let's look at the package contents for details, but only the first two or three directory levels.

  • build [8 KB]
    • MonoAndroid10
    • net45
    • Xamarin.iOS10
  • lib [1.9 MB]
    • net45
    • netstandard1.5
    • netstandard2.0
  • runtimes [137.5 MB]
    • linux [113.4 MB]
    • win [12.4 MB]
    • osx [11.7 MB]
  • native [424.6 MB]
    • android [164.3 MB]
      • x86 [56.3 MB]
      • arm64-v8a [54.3 MB]
      • armeabi-v7a [53.7 MB]
    • ios [260.3 MB]

You might wonder why the mobile runtimes are that much large than the ones for Windows or MacOS. It turns out that for Android there are native libraries for three different architectures each around 50 MB and for iOS there is not only an *_csharp_ext library, but a whole libgrpc library with 260 MB alone. For Linux there are two libraries for x86 and x64 with 44.8 MB and 68.6 MB. However, I cannot tell why the abovementioned libraries are so much larger in size than their counterparts for Windows or MacOS.

The package probably covers much more than you actually need in your project and you might want to use a more language-specific package that suits your scenario as suggested in the Grpc repository.

Related