Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Optimizing Zlib on Arm: Enhancing Web Browser Performance with NEON, Lecture notes of Benchmarking

The optimization of Zlib, a widely-used data compression library, on Arm processors, focusing on the benefits of NEON SIMD technology. The author, Adenilson Cavalcanti, discusses the potential optimization candidates and their impact on Chromium's performance. Topics include Adler-32 checksum, inflate_fast, and NEON-based compression methods.

Typology: Lecture notes

2021/2022

Uploaded on 09/12/2022

eekanath
eekanath ๐Ÿ‡บ๐Ÿ‡ธ

4.7

(18)

271 documents

1 / 44

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Optimizing Zlib on Arm:
The power of NEON
Adenilson Cavalcanti
ARM - San Jose (California)
@adenilsonc
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c

Partial preview of the text

Download Optimizing Zlib on Arm: Enhancing Web Browser Performance with NEON and more Lecture notes Benchmarking in PDF only on Docsity!

Optimizing Zlib on Arm:

The power of NEON

Adenilson Cavalcanti ARM - San Jose (California)

@adenilsonc

Why zlib?

Zlib Used everywhere (libpng, Skia, freetype, cronet , Firefox, Chrome, linux kernel, android, iOS, JDK, git, etc). Old code base released in 1995. Written in K&R C style.

Context Lacks any optimizations for ARM CPUs.

Problem statement Identify potential optimization candidates and verify positive effects in Chromium.

โ— Performed some benchmarking. โ— Contacted each project. โ— Mixed results (1 project never replied back).

Before deepening the fork...

โ— Performed some benchmarking. โ— Contacted each project. โ— Mixed results (1 project never replied back).

None focused on decompression* or had ARM specific optimizations.

Before forking...

*Important for a Web Browser.

Parrots are not created equal

Original: 2.7MB

Palette: 0.8MB

Zopfli: 2.6MB

Perf to the rescue

โ— Optional on ARMv7. โ— Mandatory on ARMv8.

NEON

Registers

ARMv โ— 16 registers@128 bits: Q

  • Q15. โ— 32 registers@64bits: D0 - D31. โ— Varied set of instructions: load, store, add, mul, etc.

ARMv โ— 32 registers@128 bits: Q0 - Q31. โ— 32 registers@64bits: D0 - D31. โ— 32 registers@32bits: S0 - S31. โ— 32 registers@8bits: H0 - H31. โ— Varied set of instructions: load, store, add, mul, etc.

Entropy & Compression

Entertaining definition

https://www.youtube.com/watch?v=l49MHwooaVQ

Practical explanation

a) HTML b) JPEG

Practical visualization

./binwalk -E filea) HTML: 0.68 b) JPEG: 0.

Adler-32 checksum

https://en.wikipedia.org/wiki/Adler-

Adler-32 simplistic implementation

https://en.wikipedia.org/wiki/Adler-