Closed dwalton76 closed 5 years ago
Perf suggestions here: http://docs.micropython.org/en/v1.9.3/pyboard/reference/speed_python.html
and this post suggest that creating float objects is very expensive https://forum.micropython.org/viewtopic.php?t=262#p1265
Try creating const()
for as many things in delta_e_cie2000
as possible.
The const() thing didn't seem to help any. For now I am going to resolve this by having micropython compute color distance via euclidean instead of cie2000. Computing the euclidean distance is drastically easier. Fixed via 665fdff393acb099420b898ad19bcda8f843cc0e
python3 takes 250ms
micropython takes ~1050ms
Why is micropython 4x slower than python? You cannot do
-m cProfile
with micropython to profile it. With python3 most of the time is spent indelta_e_cie2000()
but I do not know that that is the case with micropython. Note that with python3 we are caching the cie2000 results, if we turn that off it still only takes ~420ms.Find a way to profile micropython so we can figure out why the perf is so bad.