[Mesa-dev] [PATCH V2] util/disk_cache: compress individual cache entries

Emil Velikov emil.l.velikov at gmail.com
Thu Mar 2 14:49:51 UTC 2017


Hi Tim,

On 2 March 2017 at 01:36, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> This reduces the cache size for Deus Ex from ~160M to ~30M for
> radeonsi.
>
> I'm also seeing the following improvements in minimum fps in the
> Shadow of Mordor benchmark:
>
> no-cache:                    ~10fps
> with-cache-no-compression:   ~15fps
> with-cache-and-compression:  ~20fps
>
> Note the with cache results are from the second run after closing
> and opening the game to avoid the in-memory cache.
>
> Since we only really care about decompression I went with
> Z_BEST_COMPRESSION as suggested on irc by Steinar H. Gunderson
> who has benchmarked decompression speeds.
>
Attempting to side-step the "which compression is best" topic, I'll
just mention:
zlib has been around for a long time than many others so,
a) chances are smaller that vendors that ship their own, but even if they do
b) the API should be stable across the system and bundled one.

If not we can reconsider if things get hairy ;-)

A couple of small suggestions below.


> +ZLIB_REQUIRED=1.2.8
>
Any particular reason behind this version - afaict it's released in
2013 and I'm wondering if some distros may be slow/missing it.


> @@ -36,20 +36,22 @@ libmesautil_la_CPPFLAGS = \
>         -I$(top_srcdir)/src/mesa \
>         -I$(top_srcdir)/src/gallium/include \
>         -I$(top_srcdir)/src/gallium/auxiliary \
>         $(VISIBILITY_CFLAGS) \
>         $(MSVC2013_COMPAT_CFLAGS)

Add ZLIB_CFLAGS to the above.

>
>  libmesautil_la_SOURCES = \
>         $(MESA_UTIL_FILES) \
>         $(MESA_UTIL_GENERATED_FILES)
>
> +libmesautil_la_LIBADD = -lz
> +
Use ZLIB_LIBS here.

Also do squash this hunk it. It should handle the Android builds.

--- a/src/util/Android.mk
+++ b/src/util/Android.mk
@@ -53,6 +53,8 @@ $(LOCAL_GENERATED_SOURCES): PRIVATE_CUSTOM_TOOL =
$(PRIVATE_PYTHON) $^ > $@
 $(LOCAL_GENERATED_SOURCES): $(intermediates)/%.c: $(LOCAL_PATH)/%.py
        $(transform-generated-source)

+LOCAL_SHARED_LIBRARIES := libz
+
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)

@@ -88,5 +90,7 @@ $(LOCAL_GENERATED_SOURCES): PRIVATE_CUSTOM_TOOL =
$(PRIVATE_PYTHON) $^ > $@
 $(LOCAL_GENERATED_SOURCES): $(intermediates)/%.c: $(LOCAL_PATH)/%.py
        $(transform-generated-source)

+LOCAL_SHARED_LIBRARIES := libz
+


Thanks
Emil


More information about the mesa-dev mailing list