1+ Benchmarks
2+ ==========
3+
14Decoding Benchmarks
2- ===================
5+ -------------------
36
47Tests performed on Intel CPU i7-9700.
58
@@ -8,7 +11,7 @@ Tests performed on Intel CPU i7-9700.
811 DATASET = [Path(" etc_heif/arrow.heic" ), Path(" etc_heif/nokia/alpha_3_2.heic" ), Path(" etc_heif/cat.hif" )]
912
1013 Benchmark code A
11- ----------------
14+ ^^^^^^^^^^^^^^^^
1215
1316.. code-block :: python
1417
@@ -27,7 +30,7 @@ Benchmark code A
2730 benchmark.pedantic(open_heif_file, iterations = 2 , rounds = 30 , warmup_rounds = 1 )
2831
2932 Benchmark code B
30- ----------------
33+ ^^^^^^^^^^^^^^^^
3134
3235.. code-block :: python
3336
@@ -41,7 +44,7 @@ Benchmark code B
4144 benchmark.pedantic(load_thumbnails, iterations = 2 , rounds = 30 , warmup_rounds = 1 )
4245
4346 Benchmark code C
44- ----------------
47+ ^^^^^^^^^^^^^^^^
4548
4649.. code-block :: python
4750
@@ -54,7 +57,7 @@ Benchmark code C
5457 benchmark.pedantic(load_image, iterations = 1 , rounds = 30 , warmup_rounds = 1 )
5558
5659 Results
57- -------
60+ ^^^^^^^
5861
5962+-------------------------------+--------------+----------------+
6063| Benchmark | CPython 3.10 | PyPy 3.8 7.3.9 |
@@ -81,7 +84,7 @@ Results
8184Reference: :py:attr: `~pillow_heif._options.PyLibHeifOptions.ctx_in_memory `
8285
8386Conclusion
84- ----------
87+ ^^^^^^^^^^
8588
8689After optimizations it became faster from 1% to 17%, depending on operations types.
8790If you only decode main image you barely notice this changes,
@@ -93,16 +96,16 @@ Decoding of small images, what we test here by decoding thumbnails, gives us ``3
9396Decoding of big images becomes faster by 5%, after we switch to ``ctx_mem `` = ``True ``.
9497
9598Encoding benchmarks
96- ===================
99+ -------------------
97100
98- Comparing 0.2.5 and 0.3.0 on CPython 3.10
101+ Comparing 0.2.x and 0.3.x on CPython 3.10
99102
100103.. code-block :: python
101104
102105 DATASET = [Path(" rgb8_512_512_1_2.heic" ), Path(" etc_heif/nokia/alpha_3_2.heic" ), Path(" rgb10_639_480_1_3.heic" )]
103106
104107 Benchmark code A
105- ----------------
108+ ^^^^^^^^^^^^^^^^
106109
107110.. code-block :: python
108111
@@ -115,7 +118,7 @@ Benchmark code A
115118 benchmark.pedantic(save_heif_file, iterations = 1 , rounds = 40 , warmup_rounds = 1 )
116119
117120 Benchmark code B
118- ----------------
121+ ^^^^^^^^^^^^^^^^
119122
120123.. code-block :: python
121124
@@ -127,14 +130,14 @@ Benchmark code B
127130
128131 benchmark.pedantic(pillow_save_heif, iterations = 1 , rounds = 40 , warmup_rounds = 1 )
129132
130- +-------------------------------+----------+ ----------+
131- | Benchmark | 0.2.5 | 0.3.0 |
132- +===============================+==========+ ==========+
133- | **A ** `HeiFile ` mem_ctx=False | 1.81 s | 1.79 s |
134- +-------------------------------+----------+ ----------+
135- | **A ** `HeiFile ` mem_ctx=True | 1.80 s | 1.78 s |
136- +-------------------------------+----------+ ----------+
137- | **B ** `Pillow ` mem_ctx=False | 1.92 s | 1.90 s |
138- +-------------------------------+----------+ ----------+
139- | **B ** `Pillow ` mem_ctx=True | 1.91 s | 1.89 s |
140- +-------------------------------+----------+ ----------+
133+ +-------------------------------+--------------+------ ----------+
134+ | Benchmark | 0.2.5 | 0.3.0 |
135+ +===============================+==============+====== ==========+
136+ | **A ** `HeiFile ` mem_ctx=False | 1.81 s | 1.79 s |
137+ +-------------------------------+--------------+------ ----------+
138+ | **A ** `HeiFile ` mem_ctx=True | 1.80 s | 1.78 s |
139+ +-------------------------------+--------------+------ ----------+
140+ | **B ** `Pillow ` mem_ctx=False | 1.92 s | 1.90 s |
141+ +-------------------------------+--------------+------ ----------+
142+ | **B ** `Pillow ` mem_ctx=True | 1.91 s | 1.89 s |
143+ +-------------------------------+--------------+------ ----------+
0 commit comments