Skip to content
Snippets Groups Projects
  1. Sep 27, 2022
  2. Sep 16, 2022
  3. Sep 13, 2022
    • Adenilson Cavalcanti's avatar
      [zlib] Increase inflate dynamic table sizes · f48cb14d
      Adenilson Cavalcanti authored
      First patch* based on Dougall Johnson zlib research**.
      
      The basic idea is to use a bigger root table to avoid a branch
      misprediction while performing a lookup when the searched
      Huffman code is actually located in a nested sub-table.
      
      The increase of memory use in the structure inflate_state will be
      1920 bytes (i.e. 1332 - 852 = 480 x sizeof(code) = 480 x 4) per active inflate context which should be fine given that even lower spec boards generally have CPUs with a L1 cache size of 32KB.
      
      Performance gains are dependent on input entropy features plus architecture, but are a net positive on both x86 (Haswell: 5.1%), Cortex big.LITTLE.Medium (X1, A55, A76) on 32bit (6.3%, 1.44%, 5.7%) and 64bit (8.3%, 2.4%, 6.7%) plus M1 (7.6%).
      
      * https://github.com/dougallj/zlib-dougallj/commits/main
      ** https://dougallj.wordpress.com/2022/08/20/
      
      Bug: 1354990
      Change-Id: I1f784bfaf9a8108f657e3c9753030482e5026366
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3888219
      
      
      Reviewed-by: default avatarChris Blume <cblume@chromium.org>
      Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1046251}
      NOKEYCHECK=True
      GitOrigin-RevId: b40b1f7a30b58aeb0d6e4906ae25c6e4734f3b1f
      f48cb14d
  4. Sep 09, 2022
    • Adenilson Cavalcanti's avatar
      [zlib] Re-land adding PMULL based CRC-32 for aarch64 · 05e137d3
      Adenilson Cavalcanti authored
      Using the polynomial multiplication instruction allows to improve a bit
      more the decompression speed of gzipped content in zlib.
      
      The average gains are not massive though (around +4.9%), but is more expressive
      for some relevant content (e.g. +10% for HTMLx4 & JPEG, +6% for JS) in more
      recent chip designs.
      
      While at it, ensure that the crypto accelerated CRC-32 will work if users decide
      to call crc32_z() instead, a 'new' (for zlib standards...) API introduced in 2017.
      
      Bug: 873725
      Change-Id: Ibb8967fb74b97f99e338ef9dc31a0ec8010aeedf
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3862996
      
      
      Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
      Reviewed-by: default avatarChris Blume <cblume@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1045228}
      NOKEYCHECK=True
      GitOrigin-RevId: 81df8c8ea3e6aa8a1d7b505206606e4ec70b4c63
      05e137d3
  5. Sep 07, 2022
  6. Sep 05, 2022
  7. Sep 01, 2022
  8. Aug 25, 2022
    • Adenilson Cavalcanti's avatar
      Sync with zlib 1.2.12.1, patch 1 of N · 926ac230
      Adenilson Cavalcanti authored
      Ported:
       - Change version number on develop branch to 1.2.12.1.
       - Fix odd error in Visual C compiler preventing automatic promotion.
       - Fix inflateBack to detect invalid input with distances too far.
       - Have infback() deliver all of the available output up to any error.
       - Fix a bug when getting a gzip header extra field with inflate().
       - Fix extra field processing bug that dereferences NULL state->head.
       - Fix some typos.
      
      Bug: 1355103
      Change-Id: I838b3f7c885a97d72e040e5a5224bc0aa58068fb
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3853109
      
      
      Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
      Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1039413}
      NOKEYCHECK=True
      GitOrigin-RevId: 29ee00aece42bd66b1a7196aa41275baad2dd512
      926ac230
  9. Aug 01, 2022
    • Adenilson Cavalcanti's avatar
      [zlib] Only write padding bytes for DEBUG builds · 8d1d3e34
      Adenilson Cavalcanti authored
      In chunk_copy decompression optimization, we perform wide loads/stores within
      the internal zstream buffer.
      
      The SIMD optimization assumes that it can perform wide stores, sometimes
      overwriting data on the output pointer (but never overflowing the buffer's
      end as it has enough room for the write), while keeping track of the
      length of decompressed stream.
      
      To help fix buggy client code, the rest of the buffer is filled with
      a defined character (since that will make faulty client code to fail
      soon and fail fast).
      
      It is save to say after all these years that Chromium code is well
      behaved and works fine with the optimization, therefore we can enable
      this only for DEBUG builds.
      
      Change requested by Volker Simonis.
      
      Bug: 1302606
      Change-Id: I5ee9e7178fbbff40bf1e4f409fc528ad65597dde
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3518085
      
      
      Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
      Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
      Reviewed-by: default avatarChris Blume <cblume@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1030214}
      NOKEYCHECK=True
      GitOrigin-RevId: 36be3c7a465f00f4edefccc10bba00bbebe1843d
      8d1d3e34
  10. Jul 29, 2022
  11. May 31, 2022
  12. May 23, 2022
    • Adenilson Cavalcanti's avatar
      Revert "[zlib] Adding PMULL based CRC-32 for aarch64" · 0e6b3ca1
      Adenilson Cavalcanti authored
      This reverts commit a0771caebe87477558454cc6d793562e3afe74ac.
      
      Reason for revert: Missing call to CPU features detection
      
      Original change's description:
      > [zlib] Adding PMULL based CRC-32 for aarch64
      >
      > Using the polynomial multiplication instruction allows to improve a bit
      > more the decompression speed of gzipped content in zlib.
      >
      > The average gains are not massive though (around +4.9%), but is more expressive
      > for some relevant content (e.g. +10% for HTMLx4 & JPEG, +6% for JS) in more
      > recent chip designs.
      >
      > Since Chrome is distributed as a 64bit binary (i.e. aarch64) only for
      > higher end devices, it should be safe from a performance perspective.
      >
      > For lower spec devices, the same serial crc32 code using the crypto
      > extensions is used, therefore no change on behavior for 32bit.
      >
      > Bug: 873725
      > Change-Id: I33b9b345b82b5256ec922324984f9a371949bbe6
      > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422723
      
      
      > Reviewed-by: default avatarChris Blume <cblume@chromium.org>
      > Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#1006184}
      
      Bug: 873725
      Change-Id: I7b6a2bfb60a96bc640b59187c5dd63590d09599e
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3659852
      
      
      Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Commit-Queue: Noel Gordon <noel@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1006331}
      NOKEYCHECK=True
      GitOrigin-RevId: 42a820acf433146b284bb195b0c3507244cf1c30
      0e6b3ca1
  13. May 22, 2022
    • Adenilson Cavalcanti's avatar
      [zlib] Adding PMULL based CRC-32 for aarch64 · 80b28c99
      Adenilson Cavalcanti authored
      Using the polynomial multiplication instruction allows to improve a bit
      more the decompression speed of gzipped content in zlib.
      
      The average gains are not massive though (around +4.9%), but is more expressive
      for some relevant content (e.g. +10% for HTMLx4 & JPEG, +6% for JS) in more
      recent chip designs.
      
      Since Chrome is distributed as a 64bit binary (i.e. aarch64) only for
      higher end devices, it should be safe from a performance perspective.
      
      For lower spec devices, the same serial crc32 code using the crypto
      extensions is used, therefore no change on behavior for 32bit.
      
      Bug: 873725
      Change-Id: I33b9b345b82b5256ec922324984f9a371949bbe6
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422723
      
      
      Reviewed-by: default avatarChris Blume <cblume@chromium.org>
      Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1006184}
      NOKEYCHECK=True
      GitOrigin-RevId: a0771caebe87477558454cc6d793562e3afe74ac
      80b28c99
  14. May 18, 2022
  15. May 17, 2022
  16. May 15, 2022
    • Noel Gordon's avatar
      [zlib_bench] check deflate consumed all input · 7085d03b
      Noel Gordon authored
      zlib_compress deflate() should consume all the input data. Add a check
      and fail the deflation if there is unconsumed input data when the zlib deflate() call returns.
      
      What about inflate()? zlib_bench knows the expected length of the data
      (it is the original input length) and fails with a Z_DATA_ERROR if the zlib_uncompress inflate() output data length does not match.
      
      Bug: 798943
      Change-Id: Ibdc9752754a52343ea6139ce9cc5a99c2a0a57a7
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3630105
      
      
      Auto-Submit: Noel Gordon <noel@chromium.org>
      Reviewed-by: default avatarChris Blume <cblume@chromium.org>
      Commit-Queue: Chris Blume <cblume@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1003565}
      NOKEYCHECK=True
      GitOrigin-RevId: 4cc4f4c0086c2e5ad52bff6be7e2430b72ebcba9
      7085d03b
  17. May 13, 2022
  18. May 12, 2022
  19. May 03, 2022
  20. May 02, 2022
  21. Apr 30, 2022
    • Noel Gordon's avatar
      [zlib bench] Add script to run zlib_bench --check[-binary] files ... · 961141d1
      Noel Gordon authored
      Given an input file corpus, run zlib_bench --check[-binary] over those
      files and output the results to stdout.
      
      Bug: 798943,1316541
      Change-Id: If99ea34af7f05698e8cea1dc3ca7e548b9f9d1bc
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3614630
      
      
      Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
      Commit-Queue: Noel Gordon <noel@chromium.org>
      Auto-Submit: Noel Gordon <noel@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#998063}
      NOKEYCHECK=True
      GitOrigin-RevId: 25ee43caf00528cee12f4d10c6202766ebe0afe7
      961141d1
    • Noel Gordon's avatar
      [zlib][asop] Complete USE_ZLIB_RABIN_KARP_ROLLING_HASH feature · 27c2f474
      Noel Gordon authored
      If USE_ZLIB_RABIN_KARP_ROLLING_HASH build-time option is defined, use
      the Rabin-Karp hash. This disables CRC SIMD hashing on ARM and Intel,
      which will degrade compression speed.
      
      However, the compressed output matches canonical zlib output, for the
      same input, and that should resolve ASOP OTA issue 1316541.
      
      To ensure the Rabin-Karp hash is used correctly in chromium zlib, the
      first step is to go back to using canonical fill_window(). To do this
      combine the ARM NEON and Intel SSE2 slide_hash() routines in a common
      framework called slide_hash_simd(). Remove fill_window_sse.c and undo
      deflate_read_buf() rename: name it back to canonical read_buf().
      
      Change insert_string(): by default it uses CRC32C hashes on all ports
      (ARM, Intel) so add code comments to state that. If Rabin-Karp hashes
      are enabled, disable CRC32C hashes.
      
      Add a new deflate internal state variable chromium_zlib_hash, used to
      detect which type of hashing is enabled (Rabin-Karp, CRC32C). Set the
      state variable in deflateInit2_ after cpu_check_features() detection,
      with #ifdef guards matching the #ifdef logic of insert_string().
      
      Change canonical fill_window() to insert hashes into {hash,prev} hash
      chains based on hash type (Rabin-Karp, CRC32C). Prior to this change,
      the ARM port was inserting Rabin-Karp hashes into hash chains even if
      CRC32 hashing was active when s->insert was > 0.
      
      Change longest_match() and deflate_fast(): update them to use the new
      deflate state variable chromium_zlib_hash.
      
      Compression performance degrades when Rabin-Karp hashing is used, but
      is unchanged when CRC32C hashing is enabled (chromium zlib default).
      
      Compat: if Rabin-Karp hashing is enabled, zlib-bench --check built as normal and against canonical zlib 1.2.11, produce the same compressed output for the snappy corpora for gzip,zlib,raw types and compression levels 1..9.
      
      Bug: 1316541
      Change-Id: I0d5ee6240f0b7eac4653d60a29d459d994c3871f
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3596671
      
      
      Reviewed-by: default avatarChris Blume <cblume@chromium.org>
      Commit-Queue: Noel Gordon <noel@chromium.org>
      Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#998062}
      NOKEYCHECK=True
      GitOrigin-RevId: 2bd100e46361a459b41a29212ea8f97a4837a06c
      27c2f474
    • Noel Gordon's avatar
      [zlib bench] Add check option modifier --check-binary · 61174f4f
      Noel Gordon authored
      Per CL:3591994 if the --check option is given, compress the input file
      and output the length and crc32 of the compressed data.
      
      Add check option modifier: --check-binary, which writes the compressed
      data to the output as well.
      
      Also normalize the check output compression details: use the base-name
      of the input file, instead of its full-path name.
      
      Bug: 798943,1316541
      Change-Id: Ia27f09b1ad583bda8e9c82c62a5b24b619f6713a
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3616433
      
      
      Commit-Queue: Noel Gordon <noel@chromium.org>
      Auto-Submit: Noel Gordon <noel@chromium.org>
      Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
      Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#998055}
      NOKEYCHECK=True
      GitOrigin-RevId: 5ae6f05e848868027ac1a78f191c4a43919e8c94
      61174f4f
  22. Apr 29, 2022
    • Adenilson Cavalcanti's avatar
      [zlib] Re-sync with zlib 1.2.12, patch 15 of N · e28c5403
      Adenilson Cavalcanti authored
      The last two changes came from the 'develop' branch of canonical
      zlib and should address some issues on 1.2.12 that are going to
      be featured on the upcoming 1.2.12.x.
      
      With this patch landing, Chromium's zlib will be 1.2.12 + fixes
      (plus our optimizations).
      
      Ported:
       - Eliminate use of ULL constants.
       - Fix crc32.c to compile local functions only if used.
       - zlib 1.2.12
       - Silence some warnings from Visual Studio C.
       - Correct incorrect inputs provided to the CRC functions.
      
      Bug: 1032721
      Change-Id: I3903ae4de5f42427fae1cca8052ad300f5a07b30
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3611239
      
      
      Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
      Reviewed-by: default avatarChris Blume <cblume@chromium.org>
      Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#997532}
      NOKEYCHECK=True
      GitOrigin-RevId: 9eb3d1c886a4dd302304241e74a75127e2069d17
      e28c5403
  23. Apr 28, 2022
  24. Apr 26, 2022
  25. Apr 25, 2022
  26. Apr 22, 2022
  27. Apr 21, 2022
  28. Apr 20, 2022
  29. Apr 19, 2022
    • Noel Gordon's avatar
      [zlib_bench] Add compressed data integrity --check option · be2c3787
      Noel Gordon authored
      If --check option is given, compress the input file. Report the length
      of the compresssed data, and the crc32 of the compressed data.
      
      For the GZIP and ZLIB DEFLATE stream types, also report the data those
      stream types [1] store at the end of the compressed data.
      
      Add the --check option to program usage message. Also change the usage
      message to always report the zlib verion number.
      
      [1] See RFC-1952 GZIP, RFC 1950 ZLIB.
      
      Bug: 798943,1316541
      Change-Id: Id9d5a918b3ae142077d654f82ca6c9bd40762cfe
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3591994
      
      
      Auto-Submit: Noel Gordon <noel@chromium.org>
      Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
      Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#993581}
      NOKEYCHECK=True
      GitOrigin-RevId: ce61cdae957433ff9955863b07826f0d6fdc9f3c
      be2c3787
  30. Apr 11, 2022
Loading