Skip to content

45MB of dev-only files (ext/h3/src/tests, ext/h3/src/website) inside the gem #130

@oleksii-leonov

Description

@oleksii-leonov

Installed gem size is ~59MB, which seems too large.

I start looking inside the installed gem folder:

h3-3.7.4# du -sh * | sort -h

4.0K    CHANGELOG.md
4.0K    CONTRIBUTING.md
4.0K    Gemfile
4.0K    Gemfile.lock
4.0K    h3.gemspec
4.0K    LICENSE.md
4.0K    Rakefile
4.0K    README.md
96K     lib
212K    spec
59M     ext

Inside the ext/h3/src/ folder:

h3-3.7.4# du -sh ext/h3/src/* | sort -h
0       ext/h3/src/Testing
4.0K    ext/h3/src/CONTRIBUTING.md
4.0K    ext/h3/src/DartConfiguration.tcl
4.0K    ext/h3/src/RELEASE.md
4.0K    ext/h3/src/VERSION
8.0K    ext/h3/src/cmake_install.cmake
8.0K    ext/h3/src/CPackConfig.cmake
8.0K    ext/h3/src/CPackSourceConfig.cmake
8.0K    ext/h3/src/generated
8.0K    ext/h3/src/KML
8.0K    ext/h3/src/README.md
12K     ext/h3/src/CHANGELOG.md
12K     ext/h3/src/cmake
12K     ext/h3/src/LICENSE
20K     ext/h3/src/CMakeCache.txt
24K     ext/h3/src/examples
24K     ext/h3/src/scripts
32K     ext/h3/src/CMakeLists.txt
64K     ext/h3/src/CTestTestfile.cmake
100K    ext/h3/src/dev-docs
100K    ext/h3/src/docs
172K    ext/h3/src/compile_commands.json
248K    ext/h3/src/lib
280K    ext/h3/src/Makefile
908K    ext/h3/src/src
1.9M    ext/h3/src/bin
3.5M    ext/h3/src/website
11M     ext/h3/src/CMakeFiles
41M     ext/h3/src/tests

It appears that a significant amount of space is consumed by ext/h3/src/tests (41 MB) and ext/h3/src/website (3.5 MB), which are not necessary for the published gem. Additionally, there are numerous other files (examples, etc.) that could be safely removed.

It is good practice to remove any files that are not necessary for the gem production functionality, to keep the gem smaller.

I am not deeply aware of h3 internals, but I believe the following folders could be excluded in gemspec safely to save ~45MB of size (reduce total gem size from 59MB to 14MB):

spec
ext/h3/src/examples
ext/h3/src/dev-docs
ext/h3/src/docs
ext/h3/src/website
ext/h3/src/tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions