cwebp verbose encoding time question

97 views
Skip to first unread message

Martin Over

unread,
Feb 24, 2023, 1:54:37 PMFeb 24
to WebP Discussion

Hi, 

Is "Time to encode picture" also measuring the writing process?

 I measure the time before and after cwebp.exe

 echo %time%

cwebp.exe  -v  input.png -o output.webp
echo %time%

 When I subtract "Time to encode picture" and "Time to read input" from the absolute time, I always get about 60 - 80 ms.  

128 * 128 Pixel input image 

Start Time: 19:47:26,41

Time to read input: 0.017s

Time to encode picture: 0.008s

End Time: 19:47:26,48

100 – 17 – 8 = 75 ms 

2048 * 2048 Pixel input image

Start Time: 19:49:30,65

Time to read input: 0.068s

Time to encode picture: 1.051s

End Time: 19:49:31,83

100 – 17 – 8 = 75 ms

1180 – 68 – 1051 = 61 ms

 

Best regards,

 Martin

James Zern

unread,
Feb 24, 2023, 3:27:53 PMFeb 24
to webp-d...@webmproject.org
Hi,

On Fri, Feb 24, 2023 at 10:54 AM Martin Over <overma...@gmail.com> wrote:

Hi, 

Is "Time to encode picture" also measuring the writing process?


No, only the encode of the image [1][2].
 

 I measure the time before and after cwebp.exe

 echo %time%

cwebp.exe  -v  input.png -o output.webp
echo %time%

 When I subtract "Time to encode picture" and "Time to read input" from the absolute time, I always get about 60 - 80 ms.  


Some extra time should be expected since the only timing done is around the read and encode, so doesn't include any initial setup (process creation, library loads, etc) or the write.
The timing was mostly added for optimization purposes so we were concerned with the initial import and encode of the image. If the file writing time is interesting to you it could be added to balance things out. 

128 * 128 Pixel input image 

Start Time: 19:47:26,41

Time to read input: 0.017s

Time to encode picture: 0.008s

End Time: 19:47:26,48

100 – 17 – 8 = 75 ms 

2048 * 2048 Pixel input image

Start Time: 19:49:30,65

Time to read input: 0.068s

Time to encode picture: 1.051s

End Time: 19:49:31,83

100 – 17 – 8 = 75 ms

1180 – 68 – 1051 = 61 ms

 

Best regards,

 Martin



Martin Over

unread,
Feb 26, 2023, 2:36:53 AMFeb 26
to WebP Discussion, James Zern
Thanks,

After experimenting with different sizes of very large images, I can see a significant difference.
C simply writes too fast compared to Java.

Reply all
Reply to author
Forward
0 new messages