以下の内容はhttps://baba-s.hatenablog.com/entry/2023/12/04/133718より取得しました。


【Unity】gzip と brotli の圧縮・展開の比較

使用するクラス

検証用のクラス

using MyProject;
using Unity.Profiling;
using UnityEngine;

public sealed class Example : MonoBehaviour
{
    private void Start()
    {
        const int    count = 10000;
        const string text  = "ピカチュウ";

        var gzipCompressedBytes   = GZipCompressor.Compress( text );
        var brotliCompressedBytes = BrotliCompressor.Compress( text );

        using ( new ProfilerMarker( "1. gzip compress" ).Auto() )
        {
            for ( var i = 0; i < count; i++ )
            {
                GZipCompressor.Compress( text );
            }
        }

        using ( new ProfilerMarker( "2. gzip decompress" ).Auto() )
        {
            for ( var i = 0; i < count; i++ )
            {
                GZipCompressor.Decompress( gzipCompressedBytes );
            }
        }

        using ( new ProfilerMarker( "3. brotli compress" ).Auto() )
        {
            for ( var i = 0; i < count; i++ )
            {
                BrotliCompressor.Compress( text );
            }
        }

        using ( new ProfilerMarker( "4. brotli decompress" ).Auto() )
        {
            for ( var i = 0; i < count; i++ )
            {
                BrotliCompressor.Decompress( brotliCompressedBytes );
            }
        }
    }
}

検証結果




以上の内容はhttps://baba-s.hatenablog.com/entry/2023/12/04/133718より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14