Skip to content

Commit

Permalink
log output size
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Dec 4, 2021
1 parent 7ec0b68 commit 37c74ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/xpra/codecs/benchmark_picture_encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def main(fmt="png", files=()):
rgb_data, pixel_format, len(pixel_format)*8, stride,
planes=ImageWrapper.PACKED, thread_safe=True)
for enc in encoders:
size = 0
start = monotonic()
for _ in range(N):
try:
Expand All @@ -49,10 +50,12 @@ def main(fmt="png", files=()):
if not r:
print("Error: no data for %s %s" % (enc.get_type(), enc.encode))
break
size += len(r[1])
if not r:
continue
end = monotonic()
print("%-10s : %.1f MPixels/s" % (enc.get_type(), w*h*N/(end-start)/1024/1024))
print("%-10s : %.1f MPixels/s size=%iKB" % (
enc.get_type(), w*h*N/(end-start)/1024/1024, size*N/1024))
cdata = r[1]
#verify that the png data is valid using pillow:
from io import BytesIO
Expand Down

0 comments on commit 37c74ab

Please sign in to comment.