You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prints (this is the time each function call takes, in milliseconds):
Width=2 (unicode, truecolor) took 3.259595004012226
Width=100 (unicode, truecolor) took 13.441674665999017
Width=2 (unicode, 256color) took 3.350438164998195
Width=100 (unicode, 256color) took 314.9447129469918
Width=2 (truecolor) took 3.495372111996403
Width=100 (truecolor) took 6.761303802995826
Width=2 (256color) took 3.4730656869942322
Width=100 (256color) took 140.41951910499483
Which is confirming that the part that's mapping colours from the image to terminal colours is a bit slow. I might try and re-implement it in C++, or investigate different data-structures, because Python's just kinda slow at it. :/
Thanks, adding is_truecolor=True, is_256color=False did increase the performance :-)
I see that the colour mapping functions take the most time for computing. I hope re-implementing this in C++ optimizes and improves it.
Activity
pnappa commentedon Sep 12, 2021
Thanks for the feedback!
I took a look at this, and it looks like most expensive part occurs for non-
truecolorcolour schemes.TL;DR: Use
is_truecolor=True, is_256colour=False, if your terminal supports it.Some cProfile stats, sorted by the total time spent in each line, for the input:
Now, it's much different for this:
Note, yeah, I notice that it's kinda annoying to enable truecolour, using default values gets in the way here.
Log:
I benchmarked a bunch of different invocations, too:
Prints (this is the time each function call takes, in milliseconds):
Which is confirming that the part that's mapping colours from the image to terminal colours is a bit slow. I might try and re-implement it in C++, or investigate different data-structures, because Python's just kinda slow at it. :/
bugbrekr commentedon Sep 12, 2021
Thanks, adding
is_truecolor=True, is_256color=Falsedid increase the performance :-)I see that the colour mapping functions take the most time for computing. I hope re-implementing this in C++ optimizes and improves it.
pnappa commentedon Dec 4, 2021
Haha, don't worry about closing the issue, I'm still looking to fix the performance issues for 256 bit colour, just haven't had the time quite yet :)
Thanks again for pointing it out!
bugbrekr commentedon Dec 5, 2021
Okay, sorry. That's cool then.
Thanks 👍