I'm experiencing very slow frame rates on a particular set up and need some help to understand
what may be causing it.
On this machine, the code below has an avg fram rate of around 45fps.
The specs are fine:
Intel(R) Core(TM) i7-5930K CPU @ 3.50GHz
"glxgears" runs happily at 60fps on this machine.
I can run the code below on a on slower machine (my laptop) with the same software config
(F31/Python3.7/Pygame1.9.6) and easily get the 60fps.
Any pointers to what may be causing this? Oh, a note, the larger the display size,
the slower it gets. 1440x900 is just the size of the laptop screen, so the larger I
could use to compare using the same version of Fedora.
import pygame
pygame.init()
clock = pygame.time.Clock()
screen_flags = 0
screen = pygame.display.set_mode((1440, 900), screen_flags)
pygame.display.set_caption("FPS Test")
print(
pygame.display.Info())
def run():
x = 0
fps = [0] * 100
while x < 100:
screen.fill(pygame.Color(0, 0, 0))
pygame.display.flip()
clock.tick(60)
fps[x] = clock.get_fps()
x += 1
print(sum(fps)/100.)
import cProfile
cProfile.run('run()')