为什么Grpc.Core NuGet包这么大? [英] Why is Grpc.Core NuGet package so big?
问题描述
最新的Grpc.Core NuGet程序包大150 MB.它似乎在其生命中一直稳定增长.以下是一些示例:
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(2018年12月)48.34 MB
- v2.23.1(2019年8月)68.11 MB
- v2.30.0(2020年6月)150.28 MB
也许这不是一对一的事情,但作为一个随机的例子,Entity Framework Core程序包为859 KB.
Maybe this is not apples-to-apples, but to pick a random example the Entity Framework Core package is 859 KB.
我很好奇这个包装中的东西使它如此之大.对于正在创建简单C#服务的人来说,也许有些东西不是完全必要的吗?
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?
推荐答案
包含库和构建脚本的软件包的核心功能总计不到2 MB.打包的原因在于它包含用于 Linux , Windows 和 Mac OSX 的运行时文件,以及用于的本机库. iOS 和 Android .让我们看一下软件包的内容以了解详细信息,但仅查看前两个或三个目录级别.
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.
- 内部版本[8 KB]
- MonoAndroid10
- net45
- Xamarin.iOS10
- build [8 KB]
- MonoAndroid10
- net45
- Xamarin.iOS10
- net45
- netstandard1.5
- netstandard2.0
- linux [113.4 MB]
- 赢[12.4 MB]
- osx [11.7 MB]
- android [164.3 MB]
- x86 [56.3 MB]
- arm64-v8a [54.3 MB]
- armeabi-v7a [53.7 MB]
- android [164.3 MB]
- x86 [56.3 MB]
- arm64-v8a [54.3 MB]
- armeabi-v7a [53.7 MB]
您可能想知道为什么移动运行时间要比 Windows 或 MacOS 大.事实证明,对于 Android ,存在用于三种不同体系结构的本机库,每个库约50 MB,而对于 iOS ,不仅存在
*_csharp_ext
库,而且还存在整个仅拥有260 MB的库.对于 Linux ,有两个用于x86和x64的库,分别为44.8 MB和68.6 MB.但是,我不知道为什么上述库的大小比 Windows 或 MacOS 的库大得多. 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 wholelibgrpc
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.
这篇关于为什么Grpc.Core NuGet包这么大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!