treeform / pixie

Full-featured 2d graphics library for Nim.
MIT License
743 stars 28 forks source link

use trapezoid method more #456

Closed guzba closed 2 years ago

guzba commented 2 years ago

filling:

before:

[pixie] pentagon opaque ............ 0.079 ms      0.082 ms    ±0.006  x1000
[pixie] pentagon not opaque ........ 0.128 ms      0.136 ms    ±0.014  x1000
[pixie] circle opaque .............. 0.118 ms      0.121 ms    ±0.004  x1000
[pixie] circle not opaque .......... 0.194 ms      0.196 ms    ±0.004  x1000
[pixie] heart opaque ............... 0.154 ms      0.161 ms    ±0.012  x1000
[pixie] heart not opaque ........... 0.264 ms      0.272 ms    ±0.016  x1000

after:

[pixie] pentagon opaque ............ 0.087 ms      0.088 ms    ±0.002  x1000 (bit slower)
[pixie] pentagon not opaque ........ 0.137 ms      0.139 ms    ±0.004  x1000 (bit slower)
[pixie] circle opaque .............. 0.127 ms      0.129 ms    ±0.003  x1000 (bit slower)
[pixie] circle not opaque .......... 0.203 ms      0.206 ms    ±0.005  x1000 (bit slower)
[pixie] heart opaque ............... 0.139 ms      0.143 ms    ±0.004  x1000 (faster)
[pixie] heart not opaque ........... 0.212 ms      0.214 ms    ±0.005  x1000 (faster)

stroking:

before:

[pixie] rect opaque ................ 0.159 ms      0.163 ms    ±0.006  x1000
[pixie] rect not opaque ............ 0.160 ms      0.165 ms    ±0.011  x1000
[pixie] roundedRect opaque ......... 0.267 ms      0.272 ms    ±0.006  x1000
[pixie] roundedRect not opaque ..... 0.268 ms      0.274 ms    ±0.011  x1000
[pixie] pentagon opaque ............ 0.168 ms      0.176 ms    ±0.015  x1000
[pixie] pentagon not opaque ........ 0.168 ms      0.174 ms    ±0.010  x1000
[pixie] circle opaque .............. 0.239 ms      0.244 ms    ±0.005  x1000
[pixie] circle not opaque .......... 0.240 ms      0.244 ms    ±0.005  x1000
[pixie] heart opaque ............... 0.297 ms      0.301 ms    ±0.007  x1000
[pixie] heart not opaque ........... 0.297 ms      0.300 ms    ±0.004  x1000

after:

[pixie] rect opaque ................ 0.085 ms      0.092 ms    ±0.009  x1000 (faster)
[pixie] rect not opaque ............ 0.085 ms      0.091 ms    ±0.007  x1000 (faster)
[pixie] roundedRect opaque ......... 0.143 ms      0.145 ms    ±0.003  x1000 (faster)
[pixie] roundedRect not opaque ..... 0.143 ms      0.159 ms    ±0.032  x1000 (faster)
[pixie] pentagon opaque ............ 0.132 ms      0.135 ms    ±0.004  x1000 (faster)
[pixie] pentagon not opaque ........ 0.132 ms      0.137 ms    ±0.009  x1000 (faster)
[pixie] circle opaque .............. 0.208 ms      0.212 ms    ±0.004  x1000 (faster)
[pixie] circle not opaque .......... 0.208 ms      0.215 ms    ±0.014  x1000 (faster)
[pixie] heart opaque ............... 0.261 ms      0.267 ms    ±0.009  x1000 (faster)
[pixie] heart not opaque ........... 0.261 ms      0.266 ms    ±0.006  x1000 (faster)