p5
p5 copied to clipboard
particle system run very slowly
Describe the bug simple particle system run slowly
from p5 import *
from random import randint
class Ball():
def __init__(self):
self.x = randint(0, 800)
self.y = 0
self.vy = randint(1, 5)
def update(self):
self.y += self.vy
def display(self):
ellipse(self.x, self.y, 100, 100)
def run(self):
self.update()
self.display()
balls = []
def setup():
global balls
size(800, 600)
balls = [Ball() for i in range(100)]
def draw():
global balls
[ball.run() for ball in balls]
background('red')
run()
To Reproduce just run the code above
Expected behavior as least fluently like https://editor.p5js.org/yonghuming/full/BDkk1FPlP
System information:
- p5 release (version number or latest commit): newest
- Python version:3.7
- Operating system: windows 10
Additional context Add any other context about the problem here.
Thank you for submitting your first issue to p5py
+1 seeing same behavior on 2017 MacBook Pro
I think this issue will be solved once skia is implimented #212
skia
opengl is powerful, why p5py so slow? pygame have better experence with similar code, also arcade. mabye there are ways to figure it still use opengl and glfw
skia use glfw
You can try the new experimental renderer or visit #357. I tried the above example and it runs fine for skia