U
U
Uncle_Savva2020-06-06 19:59:28
Python
Uncle_Savva, 2020-06-06 19:59:28

Why is pygame so slow?

I can't figure out why pygame is slow! My js canvas code is faster than pygame! By the way, both programs perform the same task.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Polina Titova, 2020-06-06
@poly-titova

pyGame is based on SDL which is thread based.
When you have streams, printed messages don't really matter. Because often scheduler slides (big ones in SDL) cause print messages to be delayed. Its not that pygame is slow (that's some situations but not this one), its just that the print statement is on a separate event thread.
Try doing this in pygame, it will work just fine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question