Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Build Size significantly different in Windows Intel i5 and Mac OS Apple Silicon

Discussion in 'Web' started by ewajs, Nov 5, 2021.

  1. ewajs

    ewajs

    Joined:
    Dec 12, 2019
    Posts:
    5
    Hello everyone,
    I'm facing an issue with build sizes for the same project built on different platforms.
    In short, I use two computers to do development, a Windows Desktop and a (new) Mac Laptop. I decided to try doing some developing on my new laptop and to my disappointment I found that the WebGL build size is about 30% larger when building from the Mac.
    The project and settings are the same (it's tracked in a GIT repo and I'm building off of the same branch/commit) and I'm using the same Unity Version on both computers.

    These are the computer & project/Unity specs:

    Windows Desktop
    OS Version:
    Windows 10 Pro x64
    Processor: Intel Core i5-9400 2.90 GHz (embedded Intel Graphics)
    RAM: 48 Gb
    Unity Version/License: Unity Pro 2020.1.11f1 (Windows version)

    Mac OS Laptop (MacBook Pro 2021)
    OS Version: Mac OS Monterey (12.0.1)
    Processor: Apple M1 Pro (embedded Apple Silicon GPU)
    RAM: 32 Gb
    Unity Version/License: Unity Pro 2020.1.11f1 (Mac OS version running with Rosetta 2, not an Apple Silicon native version)

    Unity Project Build Settings
    Platform:
    WebGL
    C++ Compiler Configuration: Release
    Quality: Ultra (see attached screenshot below Quality Settings for full values)
    Compression: Brotli
    API Compatibility Level: .NET 4.x
    Strip Engine Code: ON


    When building the same scene on both computers I find that the resulting build size is significantly larger on Mac. I'm attaching information about the build folders on both computers as well as the Editor.log for the builds.

    My original though was that maybe this is a compression issue but after checking the build logs I find that even the uncompressed builds differ in size, sometimes significantly for the same item.

    Any help troubleshooting this issue is greatly appreciated, I can just work on both computers and build exclusively on the Windows one but that completely defeats the point of having Unity on a Laptop and the file size is just (proportionally) too large to ignore and accept.

    Could this be a compatibility issue that should be fixed in later/newer versions? I'm not striving for them to be equal to the last bit but 30% is just too much.

    Thanks in advance to anyone that looks into this and provides some guidance!

    Here's some parts of the logs that caught my attention (highlighting in bold colors examples of notable lines for comparison), the most salient one I found is the size for the same asset which takes up 170 Kb in Windows but a whopping 2.7 Mb on Mac (making it the single largest asset of the project as opposed to around the 20th on Windows, being more than 10x larger) :

    Windows Log
    -------------------------------------------------------------------------------
    Build Report
    Uncompressed usage by category (Percentages based on user generated assets only):
    Textures 13.4 mb 46.7%
    Meshes 20.1 kb 0.1%
    Animations 0.0 kb 0.0%
    Sounds 0.0 kb 0.0%
    Shaders 3.3 mb 11.4%
    Other Assets 567.6 kb 1.9%
    Levels 525.4 kb 1.8%
    Scripts 1.4 mb 4.7%
    Included DLLs 9.5 mb 33.3%
    File headers 26.2 kb 0.1%
    Total User Assets 28.7 mb 100.0%
    Complete build size 44.3 mb
    Used Assets and files from the Resources folder, sorted by uncompressed size:
    1.5 mb 3.4% Packages/com.unity.postprocessing/PostProcessing/Shaders/Builtins/Uber.shader
    1.3 mb 3.0% Assets/Scenes/MuseumLarge/Lightmap-3_comp_light.exr
    1.3 mb 3.0% Assets/Scenes/MuseumLarge/Lightmap-2_comp_light.exr
    1.3 mb 3.0% Assets/Scenes/MuseumLarge/Lightmap-1_comp_light.exr
    1.3 mb 3.0% Assets/Scenes/MuseumLarge/Lightmap-0_comp_light.exr
    1.3 mb 3.0% Assets/Editor/Untracked/WoodenFloors/WoodenTiles/Wood_Floor_006_NORM.jpg
    1.3 mb 3.0% Resources/unity_builtin_extra
    682.8 kb 1.5% Assets/Editor/Untracked/WoodenFloors/WoodenTiles/Wood_Floor_006_COLOR.jpg
    512.4 kb 1.1% Assets/Scenes/MuseumLarge/ReflectionProbe-0.exr
    341.5 kb 0.8% Assets/Editor/Untracked/WoodenFloors/WoodenSolid/Seamless_Fine_Wood_Texture_NORMAL.jpg
    341.5 kb 0.8% Assets/Scenes/MuseumLarge/Lightmap-4_comp_light.exr
    341.5 kb 0.8% Assets/Material/Common/Artwork/CardboardNormalMap.jpg
    341.5 kb 0.8% Packages/com.unity.probuilder/Content/Material/Textures/GridBox_Trigger.png
    341.5 kb 0.8% Packages/com.unity.probuilder/Content/Material/Textures/GridBox_Collider.png
    341.5 kb 0.8% Assets/Material/MuseumLarge/Tag/cardboard.jpg
    262.6 kb 0.6% Packages/com.unity.postprocessing/PostProcessing/Textures/SMAA/AreaTex.tga
    182.9 kb 0.4% Assets/Fonts/PlayfairDisplay-Regular.ttf
    170.8 kb 0.4% Assets/Material/Common/Artwork/RoughWoodNormalMap.jpg
    170.8 kb 0.4% Assets/Material/Common/Artwork/PaintedWoodNormalMap.jpg
    170.8 kb 0.4% Assets/Editor/Untracked/WoodenFloors/WoodenPlankDark/wildtextures_seamless_dark_wood_floor 1.jpg
    170.8 kb 0.4% Assets/Editor/Untracked/ConcreteFloors/ConcreteWhite/Concrete Seamless Texture #584.jpg
    170.8 kb 0.4% Assets/Editor/Untracked/ConcreteFloors/ConcreteJagged/Concrete Seamless Texture #7124.jpg
    170.8 kb 0.4% Assets/Editor/Untracked/ConcreteFloors/ConcreteGrey/Concrete Seamless Texture #6660.jpg

    -------------------------------
    Windows Log Truncated here.

    Mac OS Log
    -------------------------------------------------------------------------------
    Build Report
    Uncompressed usage by category (Percentages based on user generated assets only):
    Textures 15.9 mb 50.5%
    Meshes 26.8 kb 0.1%
    Animations 0.0 kb 0.0%
    Sounds 0.0 kb 0.0%
    Shaders 3.5 mb 11.3%
    Other Assets 567.6 kb 1.8%
    Levels 525.4 kb 1.6%
    Scripts 1.4 mb 4.3%
    Included DLLs 9.5 mb 30.3%
    File headers 26.2 kb 0.1%
    Total User Assets 31.5 mb 100.0%
    Complete build size 49.2 mb
    Used Assets and files from the Resources folder, sorted by uncompressed size:
    2.7 mb 5.4% Assets/Editor/Untracked/WoodenFloors/WoodenPlankDark/wildtextures_seamless_dark_wood_floor 1.jpg
    1.6 mb 3.2% Resources/unity_builtin_extra
    1.5 mb 3.1% Packages/com.unity.postprocessing/PostProcessing/Shaders/Builtins/Uber.shader
    1.3 mb 2.7% Assets/Scenes/MuseumLarge/Lightmap-3_comp_light.exr
    1.3 mb 2.7% Assets/Scenes/MuseumLarge/Lightmap-2_comp_light.exr
    1.3 mb 2.7% Assets/Scenes/MuseumLarge/Lightmap-1_comp_light.exr
    1.3 mb 2.7% Assets/Scenes/MuseumLarge/Lightmap-0_comp_light.exr
    1.3 mb 2.7% Assets/Editor/Untracked/WoodenFloors/WoodenTiles/Wood_Floor_006_NORM.jpg
    682.8 kb 1.4% Assets/Editor/Untracked/WoodenFloors/WoodenTiles/Wood_Floor_006_COLOR.jpg
    512.4 kb 1.0% Assets/Scenes/MuseumLarge/ReflectionProbe-0.exr
    341.5 kb 0.7% Assets/Editor/Untracked/WoodenFloors/WoodenSolid/Seamless_Fine_Wood_Texture_NORMAL.jpg
    341.5 kb 0.7% Assets/Scenes/MuseumLarge/Lightmap-4_comp_light.exr

    -------------------------------
    Mac OS Log Truncated here.

    Screenshots
    Mac OS Build Folder Info
    Mac OS - Apple Silicon - Build Folder.png

    Windows Build Folder Info
    Windows - Intel Core i5 - Build Folder.PNG

    Quality Settings
    Quality Settings.PNG
     

    Attached Files:

    magnetic_scho likes this.
  2. magnetic_scho

    magnetic_scho

    Joined:
    Feb 2, 2020
    Posts:
    91
    Did you find a solution/explanation to this issue?

    We currently face a similar one. Builds from an Intel Mac are different from the ones built on Apple Silicon. Not only is the size different, but a certain issue is only present in the Intel build.