Merge pull request #104 from guzba/master

benchmarks
This commit is contained in:
treeform 2021-02-11 11:27:53 -08:00 committed by GitHub
commit 133bb0aa11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,41 +1,45 @@
import pixie, chroma, vmath, benchy
block:
var a = newImage(1000, 1000)
let
a = newImage(1000, 1000)
b = newImage(50, 50)
a.fill(rgba(255, 0, 0, 255))
var b = newImage(500, 500)
b.fill(rgba(0, 255, 0, 255))
timeIt "drawCorrect bmNormal":
a.drawCorrect(b, translate(vec2(25, 25)), bmNormal)
keep(b)
block:
var a = newImage(1000, 1000)
a.fill(rgba(255, 0, 0, 255))
var b = newImage(500, 500)
b.fill(rgba(0, 255, 0, 255))
timeIt "draw bmNormal":
timeIt "draw small-on-big bmNormal":
a.draw(b, translate(vec2(25, 25)), bmNormal)
keep(b)
block:
var a = newImage(1000, 1000)
let
a = newImage(1000, 1000)
b = newImage(50, 50)
a.fill(rgba(255, 0, 0, 255))
var b = newImage(500, 500)
b.fill(rgba(0, 255, 0, 255))
timeIt "drawCorrect Smooth bmNormal":
a.drawCorrect(b, translate(vec2(25.2, 25.2)), bmNormal)
timeIt "draw small-on-big Smooth bmNormal":
a.draw(b, translate(vec2(25.2, 25.2)), bmNormal)
keep(b)
block:
var a = newImage(1000, 1000)
let
a = newImage(1000, 1000)
b = newImage(500, 500)
a.fill(rgba(255, 0, 0, 255))
var b = newImage(500, 500)
b.fill(rgba(0, 255, 0, 255))
timeIt "draw Smooth bmNormal":
timeIt "draw big-on-bigger bmNormal":
a.draw(b, translate(vec2(25, 25)), bmNormal)
keep(b)
block:
let
a = newImage(1000, 1000)
b = newImage(500, 500)
a.fill(rgba(255, 0, 0, 255))
b.fill(rgba(0, 255, 0, 255))
timeIt "draw big-on-bigger Smooth bmNormal":
a.draw(b, translate(vec2(25.2, 25.2)), bmNormal)
keep(b)