mkxp-z/tests/benchmark-bitmap-dup/dup-speed-test.rb
Splendide Imaginarius 7e9937b80f Bitmap: short-circuit shader/bilinear interpolation
Benchmark shows a speedup from 10.4s to 4.1s.
2024-10-23 22:36:00 +00:00

47 lines
741 B
Ruby
Executable file

# Test suite for mkxp-z.
# Copyright 2023-2024 Splendide Imaginarius.
# License GPLv2+.
#
# Run the suite via the "customScript" field in mkxp.json.
def dump(bmp, spr, desc)
spr.bitmap = bmp
Graphics.wait(1)
end
src = Bitmap.new("Graphics/Pictures/lime")
starttime = System.uptime
for i in 1..100 do
dst1 = src.dup
dst2 = src.dup
dst3 = src.dup
dst4 = src.dup
dst5 = src.dup
dst6 = src.dup
dst7 = src.dup
dst8 = src.dup
dst9 = src.dup
dst10 = src.dup
dst1.dispose
dst2.dispose
dst3.dispose
dst4.dispose
dst5.dispose
dst6.dispose
dst7.dispose
dst8.dispose
dst9.dispose
dst10.dispose
GC.start
Graphics.wait(1)
end
endtime = System.uptime
System::puts("\n\nTotal dup time: %s\n\n" % [endtime - starttime])
exit