Improvements from the bilinear scaling code are written up here:
http://mattst88.com/blog/2012/07/06/...O_1,75_laptop/
HTML5 stuff looks like it's significantly faster on ARM/iwMMX now.
Phoronix: Pixman 0.28 Packs In Major Features
The Pixman rendering library is out with a major new release that presents several interesting new features...
http://www.phoronix.com/vr.php?view=MTIyNDA
Improvements from the bilinear scaling code are written up here:
http://mattst88.com/blog/2012/07/06/...O_1,75_laptop/
HTML5 stuff looks like it's significantly faster on ARM/iwMMX now.
I've had to wait a while for libpixman 0.28.2 to be added to Ubuntu's xorg-edgers PPA, but finally....
Since this pixman release mentions Faster bilinear scaling on iwMMX, Loongson _and_ MMX, as well as Faster scaling in general... , I decided to test it on an ancient Athlon XP 2700+ (has MMX and SSE, but not SSE2). I installed cairo-perf-utils to get cairo-perf-trace but I was unable to uncompress the .lzma files I had downloaded from http://cgit.freedesktop.org/cairo-traces/tree/benchmark so instead I opened Firefox 17.0.1 and ran the Asteroids HTML5 Canvas 2D Rendering and JavaScript Benchmark at http://www.kevs3d.co.uk/dev/asteroidsbench/
Asteroids results on Ubuntu 12.04:
Before (libpixman-1-0 0.24.4-1) - score: 295, FPS: 7
After (libpixman-1-0 0.28.2-0ubuntu1~xedgers~precise1) - score: 320, FPS: 7
So an 8.5% increase. I'm not sure if that is significant or not.
Considering that this test is about "commonly used operations in HTML5 games: drawImage, drawImage scaling, alpha, composition, shadows and text functions", which is a bit more than just scaling, the improvement you got might be not too bad.
But to get a better idea where the time is spent, it makes sense to profile this use case. For the start, on ARM Cortex-A8 1GHz with firefox17 (compiled to use system pixman and cairo libraries instead of mozilla's internal copies) and "gfx.xrender.enabled" set to "false" in about:config, I'm getting the following scores in the same asteroids benchmark:
And profiling it with "perf record -p `pidof firefox`" while running the test, results in the following overall statistics:Code:ARM Cortex-A8 1GHz: Benchmark Score: 197 Average FPS: 5
Taking a look at the distribution of time spent in different libraries, we see that pixman is not the biggest contributor here.Code:$ perf report -s dso 37.92% libxul.so 21.40% libcairo.so.2.11200.8 16.24% libpixman-1.so.0.28.2 7.51% libfontconfig.so.1.4.4 3.49% firefox 2.56% perf-984.map 2.07% libz.so.1.2.7 1.86% libm-2.15.so 1.63% [kernel.kallsyms] 1.52% libc-2.15.so 1.14% ld-2.15.so 0.41% [unknown]
And for just pixman alone, we get the following:
The scaling operations are not particularly heavy here. Mostly it's just simple non-scaled alpha blending and blitting.Code:$ perf report | grep libpixman 4.93% firefox libpixman-1.so.0.28.2 [.] pixman_composite_over_8888_8888_asm_neon 2.98% firefox libpixman-1.so.0.28.2 [.] pixman_composite_src_8888_8888_asm_neon 2.14% firefox libpixman-1.so.0.28.2 [.] pixman_composite_src_x888_8888_asm_neon 2.06% firefox libpixman-1.so.0.28.2 [.] pixman_scaled_bilinear_scanline_8888_8_8888_OVER_asm_neon 0.44% firefox libpixman-1.so.0.28.2 [.] pixman_composite_src_n_8888_asm_neon 0.41% firefox libpixman-1.so.0.28.2 [.] pixman_composite_over_n_8_8888_asm_neon 0.29% firefox libpixman-1.so.0.28.2 [.] pixman_image_composite32 0.29% firefox libpixman-1.so.0.28.2 [.] fast_composite_scaled_bilinear_neon_8888_8_8888_pad_OVER 0.29% firefox libpixman-1.so.0.28.2 [.] analyze_extent 0.27% firefox libpixman-1.so.0.28.2 [.] pixman_composite_add_n_8_8888_asm_neon 0.23% firefox libpixman-1.so.0.28.2 [.] pixman_transform_point 0.17% firefox libpixman-1.so.0.28.2 [.] _pixman_image_validate 0.14% firefox libpixman-1.so.0.28.2 [.] compute_transformed_extents
If you are also wondering about what is done by libcairo:
You can also try a similar profiling exercise on your hardwareCode:$ perf report | grep libcairo 4.91% firefox libcairo.so.2.11200.8 [.] _cairo_tor_scan_converter_generate 1.11% firefox libcairo.so.2.11200.8 [.] _fill_xrgb32_lerp_opaque_spans 0.72% firefox libcairo.so.2.11200.8 [.] cell_list_render_edge 0.64% firefox libcairo.so.2.11200.8 [.] _cairo_spline_decompose_into 0.60% firefox libcairo.so.2.11200.8 [.] cairo_matrix_transform_point 0.44% firefox libcairo.so.2.11200.8 [.] _cairo_tor_scan_converter_add_polygon 0.35% firefox libcairo.so.2.11200.8 [.] .divsi3_skip_div0_test 0.34% firefox libcairo.so.2.11200.8 [.] _cairo_bentley_ottmann_tessellate_polygon 0.30% firefox libcairo.so.2.11200.8 [.] 0x0000e0b4 0.25% firefox libcairo.so.2.11200.8 [.] __udivsi3 0.25% firefox libcairo.so.2.11200.8 [.] outer_join 0.25% firefox libcairo.so.2.11200.8 [.] compute_face 0.20% firefox libcairo.so.2.11200.8 [.] _cairo_matrix_to_pixman_matrix_offset![]()
OK, I had to use sudo to get perf to do anything useful (otherwise it refused to run with an error about kernel symbols). And "perf report -s dso" just results in "perf: Segmentation fault". perf report works though
I think my initial test may have been meaningless. I did not realise that Firefox has internal copies of pixman and cairo and did not recompile it to use the system versions. That probably explains why perf report just shows:
and why perf report | grep libpixman just shows:Code:55.14% DNS Res~ver #37 libxul.so [.] 0xf4aa9c 17.13% DNS Res~ver #37 libfontconfig.so.1.4.4 [.] 0x72c8 5.74% DNS Res~ver #37 [kernel.kallsyms] [k] 0xc1035df8 5.46% DNS Res~ver #37 firefox [.] 0xc930 1.77% DNS Res~ver #37 perf-2141.map [.] 0x1235b22d 1.73% DNS Res~ver #37 libc-2.15.so [.] 0x7d710 1.34% DNS Res~ver #37 libfontconfig.so.1.4.4 [.] FcStrCmpIgnoreCase 1.27% DNS Res~ver #37 libfontconfig.so.1.4.4 [.] FcConfigSubstituteWit 0.80% DNS Res~ver #37 libpthread-2.15.so [.] pthread_mutex_lock 0.34% DNS Res~ver #37 libxul.so [.] vp8_idct_dequant_dc_f 0.32% DNS Res~ver #37 libfontconfig.so.1.4.4 [.] FcUtf8ToUcs4 0.31% DNS Res~ver #37 firefox [.] _start
I was originally hoping to benchmark poppler as well, but as I said in my previous post, I was unable to uncompress the .lzma files I had downloaded from the cairo-traces siteCode:[kernel.kallsyms] with build id dd11b20eac2611858a619b764b7796765d2ad877 not found, continuing without symbols Failed to open /tmp/perf-2141.map, continuing without symbols 0.00% DNS Res~ver #37 libpixman-1.so.0.28.2 [.] pixman_image_composite32
I've just worked out that I had to use the "plain" link in the far right column, instead of right-clicking on filename and selecting "Save Link As..." I'll report back how that goes.
OK, it still doesn't work. I got the file uncompressed this time, but cairo-perf-trace just gives:
Error: Found no traces in 'cairo-traces:/usr/src/cairo-traces:/usr/share/cairo-traces'.
Have you cloned the cairo-traces repository and uncompressed the traces?
git clone git://anongit.freedesktop.org/cairo-traces
cd cairo-traces && make
Or set the env.var CAIRO_TRACE_DIR to point to your traces?
ls -l /usr/share/cairo-traces gives:
total 42860
-r-------- 1 user user 43886133 Jan 9 00:29 poppler
I tried setting the environment variable (set env CAIRO_TRACE_DIR /usr/share/cairo-traces) anyway but it made no difference. Ubuntu 12.04 here.