treeform / pixie

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

bmOverwrite fast paths, move some stuff #344

Closed guzba closed 2 years ago

guzba commented 2 years ago

before:

pixie1 ............................. 0.185 ms      0.189 ms    ±0.005  x1000
pixie2 ............................. 0.308 ms      0.326 ms    ±0.024  x1000
pixie3 ............................. 0.339 ms      0.351 ms    ±0.012  x1000
pixie4 ............................. 0.194 ms      0.203 ms    ±0.014  x1000
pixie4 overwrite ................... 0.282 ms      0.299 ms    ±0.019  x1000 ***
pixie4 mask ........................ 0.059 ms      0.060 ms    ±0.001  x1000
pixie fillImage .................... 0.159 ms      0.169 ms    ±0.013  x1000

after:

pixie1 ............................. 0.185 ms      0.189 ms    ±0.006  x1000
pixie2 ............................. 0.307 ms      0.314 ms    ±0.009  x1000
pixie3 ............................. 0.340 ms      0.364 ms    ±0.031  x1000
pixie4 ............................. 0.194 ms      0.198 ms    ±0.005  x1000
pixie4 overwrite ................... 0.128 ms      0.134 ms    ±0.010  x1000 ***
pixie4 mask ........................ 0.060 ms      0.063 ms    ±0.004  x1000
pixie fillImage .................... 0.168 ms      0.174 ms    ±0.012  x1000

nim c --gc:arc -d:release -r --debugger:native .\tests\benchmark_fonts.nim

bmNormal
fill text .......................... 2.714 ms      2.799 ms    ±0.101  x1000
bmOverwrite
fill text .......................... 2.563 ms      2.635 ms    ±0.079  x1000