[cairo] 转发: software and hardware render question
苗磊
miaolei at xiaobing.ai
Tue Sep 6 01:24:59 UTC 2022
Hi,
I’m working on 2d render, I find cairo gpu is slower than cpu. I don’t know why?
At first, I saw blend2d website, it listed some 2d render performance comparison, cairo was in list. The list indicated cairo is slower than blend2d, but base on cpu test.
At that time, I thought cairo with gpu is faster than blend2d, I use its test tool, I modify codes, use cairo with gpu, but gpu is slower than cpu.
Please help me to find reason, thank you very much. The following is test result:
Cairo without opengl:
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
|Cairo | CompOp | Style | 8x8 | 16x16 | 32x32 | 64x64 |128x128|256x256|
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
|FillRectA | SrcOver | Pattern_BI | 1.2 | 1.3 | 1.8 | 4.5 | 13 | 46 |
|FillRectU | SrcOver | Pattern_BI | 3.2 | 5.8 | 11 | 20 | 59 | 197 |
|FillRectRot | SrcOver | Pattern_BI | 11 | 31 | 72 | 176 | 467 | 1405 |
|FillRoundU | SrcOver | Pattern_BI | 11 | 27 | 54 | 83 | 124 | 262 |
|FillRoundRot | SrcOver | Pattern_BI | 14 | 35 | 76 | 178 | 474 | 1435 |
|FillTriangle | SrcOver | Pattern_BI | 5.2 | 7.6 | 14 | 29 | 68 | 149 |
|FillPolyNZi10 | SrcOver | Pattern_BI | 14 | 23 | 43 | 89 | 188 | 410 |
|FillPolyEOi10 | SrcOver | Pattern_BI | 14 | 23 | 42 | 89 | 196 | 438 |
|FillPolyNZi20 | SrcOver | Pattern_BI | 26 | 44 | 89 | 170 | 348 | 724 |
|FillPolyEOi20 | SrcOver | Pattern_BI | 25 | 47 | 84 | 175 | 379 | 848 |
|FillPolyNZi40 | SrcOver | Pattern_BI | 44 | 79 | 155 | 323 | 670 | 1362 |
|FillPolyEOi40 | SrcOver | Pattern_BI | 42 | 78 | 156 | 335 | 768 | 1676 |
|FillWorld | SrcOver | Pattern_BI | 204 | 274 | 382 | 576 | 973 | 1858 |
|StrokeRectA | SrcOver | Pattern_BI | 5.1 | 5.7 | 6.1 | 8.9 | 15 | 32 |
|StrokeRectU | SrcOver | Pattern_BI | 6.9 | 8.3 | 11 | 14 | 24 | 49 |
|StrokeRectRot | SrcOver | Pattern_BI | 23 | 34 | 56 | 102 | 206 | 453 |
|StrokeRoundU | SrcOver | Pattern_BI | 23 | 37 | 64 | 86 | 100 | 126 |
|StrokeRoundRot | SrcOver | Pattern_BI | 28 | 45 | 81 | 151 | 261 | 513 |
|StrokeTriangle | SrcOver | Pattern_BI | 10 | 13 | 18 | 28 | 47 | 84 |
|StrokePoly10 | SrcOver | Pattern_BI | 34 | 51 | 83 | 137 | 233 | 403 |
|StrokePoly20 | SrcOver | Pattern_BI | 61 | 91 | 160 | 308 | 585 | 1005 |
|StrokePoly40 | SrcOver | Pattern_BI | 120 | 167 | 278 | 556 | 1203 | 2406 |
|StrokeWorld | SrcOver | Pattern_BI | 3871 | 3496 | 3199 | 3059 | 3498 | 4587 |
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
|Total | SrcOver | Pattern_BI | 4605 | 4632 | 5145 | 6707 | 10909 | 20480 |
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
|Cairo | CompOp | Style | 8x8 | 16x16 | 32x32 | 64x64 |128x128|256x256|
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
|FillRectA | SrcCopy | Pattern_BI | 0.8 | 0.9 | 1.0 | 1.6 | 3.9 | 19 |
|FillRectU | SrcCopy | Pattern_BI | 4.9 | 7.0 | 10 | 21 | 55 | 174 |
|FillRectRot | SrcCopy | Pattern_BI | 13 | 36 | 82 | 204 | 540 | 1493 |
|FillRoundU | SrcCopy | Pattern_BI | 14 | 36 | 70 | 108 | 151 | 267 |
|FillRoundRot | SrcCopy | Pattern_BI | 15 | 39 | 86 | 199 | 517 | 1493 |
|FillTriangle | SrcCopy | Pattern_BI | 6.8 | 10 | 20 | 45 | 100 | 232 |
|FillPolyNZi10 | SrcCopy | Pattern_BI | 17 | 31 | 62 | 134 | 299 | 666 |
|FillPolyEOi10 | SrcCopy | Pattern_BI | 17 | 31 | 62 | 139 | 322 | 719 |
|FillPolyNZi20 | SrcCopy | Pattern_BI | 29 | 54 | 112 | 245 | 537 | 1150 |
|FillPolyEOi20 | SrcCopy | Pattern_BI | 28 | 54 | 117 | 263 | 600 | 1390 |
|FillPolyNZi40 | SrcCopy | Pattern_BI | 49 | 89 | 186 | 420 | 939 | 2046 |
|FillPolyEOi40 | SrcCopy | Pattern_BI | 48 | 90 | 192 | 452 | 1100 | 2640 |
|FillWorld | SrcCopy | Pattern_BI | 211 | 301 | 427 | 683 | 1255 | 2558 |
|StrokeRectA | SrcCopy | Pattern_BI | 12 | 16 | 33 | 55 | 94 | 182 |
|StrokeRectU | SrcCopy | Pattern_BI | 10 | 13 | 17 | 25 | 42 | 77 |
|StrokeRectRot | SrcCopy | Pattern_BI | 28 | 46 | 81 | 152 | 299 | 556 |
|StrokeRoundU | SrcCopy | Pattern_BI | 31 | 53 | 93 | 133 | 154 | 188 |
|StrokeRoundRot | SrcCopy | Pattern_BI | 33 | 55 | 103 | 191 | 343 | 616 |
|StrokeTriangle | SrcCopy | Pattern_BI | 13 | 17 | 27 | 45 | 84 | 155 |
|StrokePoly10 | SrcCopy | Pattern_BI | 39 | 62 | 109 | 203 | 384 | 705 |
|StrokePoly20 | SrcCopy | Pattern_BI | 69 | 106 | 203 | 403 | 825 | 1612 |
|StrokePoly40 | SrcCopy | Pattern_BI | 133 | 185 | 319 | 687 | 1571 | 3480 |
|StrokeWorld | SrcCopy | Pattern_BI | 3903 | 3516 | 3253 | 3218 | 3740 | 5415 |
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
|Total | SrcCopy | Pattern_BI | 4735 | 4860 | 5676 | 8042 | 13965 | 27844 |
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
Cairo with opengl:
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
|Cairo | CompOp | Style | 8x8 | 16x16 | 32x32 | 64x64 |128x128|256x256|
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
|FillRectA | SrcOver | Pattern_BI | 24 | 26 | 44 | 58 | 90 | 419 |
|FillRectU | SrcOver | Pattern_BI | 27 | 28 | 34 | 47 | 105 | 341 |
|FillRectRot | SrcOver | Pattern_BI | 34 | 46 | 86 | 186 | 558 | 1955 |
|FillRoundU | SrcOver | Pattern_BI | 37 | 49 | 67 | 97 | 150 | 386 |
|FillRoundRot | SrcOver | Pattern_BI | 37 | 49 | 82 | 179 | 525 | 1821 |
|FillTriangle | SrcOver | Pattern_BI | 29 | 32 | 38 | 53 | 90 | 188 |
|FillPolyNZi10 | SrcOver | Pattern_BI | 39 | 52 | 74 | 119 | 222 | 503 |
|FillPolyEOi10 | SrcOver | Pattern_BI | 40 | 52 | 81 | 125 | 236 | 564 |
|FillPolyNZi20 | SrcOver | Pattern_BI | 53 | 81 | 126 | 211 | 390 | 822 |
|FillPolyEOi20 | SrcOver | Pattern_BI | 52 | 78 | 133 | 237 | 460 | 947 |
|FillPolyNZi40 | SrcOver | Pattern_BI | 72 | 116 | 211 | 385 | 751 | 1441 |
|FillPolyEOi40 | SrcOver | Pattern_BI | 70 | 117 | 232 | 464 | 935 | 1854 |
|FillWorld | SrcOver | Pattern_BI | 238 | 323 | 440 | 652 | 1097 | 2113 |
|StrokeRectA | SrcOver | Pattern_BI | 29 | 31 | 34 | 43 | 81 | 218 |
|StrokeRectU | SrcOver | Pattern_BI | 30 | 33 | 38 | 54 | 117 | 349 |
|StrokeRectRot | SrcOver | Pattern_BI | 50 | 72 | 118 | 253 | 689 | 2207 |
|StrokeRoundU | SrcOver | Pattern_BI | 54 | 77 | 116 | 159 | 220 | 455 |
|StrokeRoundRot | SrcOver | Pattern_BI | 56 | 78 | 134 | 267 | 671 | 2090 |
|StrokeTriangle | SrcOver | Pattern_BI | 36 | 41 | 50 | 68 | 110 | 226 |
|StrokePoly10 | SrcOver | Pattern_BI | 62 | 91 | 135 | 219 | 408 | 816 |
|StrokePoly20 | SrcOver | Pattern_BI | 90 | 124 | 220 | 427 | 842 | 1673 |
|StrokePoly40 | SrcOver | Pattern_BI | 153 | 195 | 332 | 716 | 1630 | 3452 |
|StrokeWorld | SrcOver | Pattern_BI | 3626 | 3218 | 2945 | 2865 | 3508 | 5306 |
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
|Total | SrcOver | Pattern_BI | 4951 | 5018 | 5782 | 7893 | 13895 | 30156 |
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
|Cairo | CompOp | Style | 8x8 | 16x16 | 32x32 | 64x64 |128x128|256x256|
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
|FillRectA | SrcCopy | Pattern_BI | 18 | 18 | 21 | 39 | 80 | 169 |
|FillRectU | SrcCopy | Pattern_BI | 659 | 881 | 927 | 941 | 949 | 1252 |
|FillRectRot | SrcCopy | Pattern_BI | 619 | 860 | 908 | 1063 | 1380 | 3105 |
|FillRoundU | SrcCopy | Pattern_BI | 690 | 943 | 964 | 988 | 996 | 1275 |
|FillRoundRot | SrcCopy | Pattern_BI | 623 | 856 | 911 | 1047 | 1342 | 2994 |
|FillTriangle | SrcCopy | Pattern_BI | 672 | 682 | 760 | 897 | 963 | 1036 |
|FillPolyNZi10 | SrcCopy | Pattern_BI | 707 | 730 | 976 | 1010 | 1098 | 1266 |
|FillPolyEOi10 | SrcCopy | Pattern_BI | 721 | 745 | 1034 | 1037 | 1111 | 1276 |
|FillPolyNZi20 | SrcCopy | Pattern_BI | 746 | 797 | 1066 | 1124 | 1244 | 1492 |
|FillPolyEOi20 | SrcCopy | Pattern_BI | 768 | 794 | 1072 | 1136 | 1320 | 1555 |
|FillPolyNZi40 | SrcCopy | Pattern_BI | 797 | 872 | 1163 | 1288 | 1557 | 2002 |
|FillPolyEOi40 | SrcCopy | Pattern_BI | 814 | 901 | 1189 | 1346 | 1696 | 2212 |
|FillWorld | SrcCopy | Pattern_BI | 1119 | 1433 | 1557 | 1729 | 1962 | 2749 |
|StrokeRectA | SrcCopy | Pattern_BI | 786 | 1066 | 1043 | 1043 | 965 | 1119 |
|StrokeRectU | SrcCopy | Pattern_BI | 759 | 1004 | 1007 | 1021 | 1000 | 1252 |
|StrokeRectRot | SrcCopy | Pattern_BI | 750 | 978 | 1052 | 1232 | 1495 | 2965 |
|StrokeRoundU | SrcCopy | Pattern_BI | 847 | 1111 | 1152 | 1186 | 1120 | 1386 |
|StrokeRoundRot | SrcCopy | Pattern_BI | 791 | 1019 | 1105 | 1318 | 1537 | 2856 |
|StrokeTriangle | SrcCopy | Pattern_BI | 831 | 851 | 949 | 1072 | 1127 | 1155 |
|StrokePoly10 | SrcCopy | Pattern_BI | 894 | 1056 | 1169 | 1263 | 1346 | 1508 |
|StrokePoly20 | SrcCopy | Pattern_BI | 951 | 1169 | 1260 | 1406 | 1656 | 2120 |
|StrokePoly40 | SrcCopy | Pattern_BI | 1115 | 1265 | 1413 | 1689 | 2222 | 3443 |
|StrokeWorld | SrcCopy | Pattern_BI | 5396 | 5012 | 4728 | 4594 | 4919 | 6269 |
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
|Total | SrcCopy | Pattern_BI | 22083 | 25053 | 27436 | 29482 | 33098 | 46466 |
+--------------------+-------------+---------------+-------+-------+-------+-------+-------+-------+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20220906/e66429d7/attachment-0001.htm>
More information about the cairo
mailing list