You could try the equivalent Go program, using OpenCV C bindings: https://github.com/lazywei/go-opencv
Hi there,I am rewriting a simple Go program (from python) that encodes many JPEG pictures -- roughly 100 images to encode. I know encoding image is CPU intensive but the equivalent Python program, which using opencv c lib, takes much much less CPU cycles (maybe 1/10?). I then did a profiling the Go program. It's not surprising that most CPU cycles are used by jpeg.Encode. Please find the attached graph. Any suggestion that I can optimize it?
Thanks,
Ming
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hmmm... This is not my experience. I don't have any reproducible sample but decoding 100 images is hardly noticeably when I run a program doing a similar thing.Of course the difference compared to a highly optimized C lib may be relatively large but for the human caller it is really fast.
Actually, the program both encodes and decodes. If there is room for improvement perhaps it can be added. I kind find the api quite easy to use though so changes there would be nice to avoid.
--