Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

particle system run very slowly #298

Open
yonghuming opened this issue Dec 11, 2020 · 6 comments
Open

particle system run very slowly #298

yonghuming opened this issue Dec 11, 2020 · 6 comments

Comments

@yonghuming
Copy link

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.

@github-actions
Copy link
Contributor

Thank you for submitting your first issue to p5py

@aaronpenne
Copy link

+1 seeing same behavior on 2017 MacBook Pro

@ReneTC
Copy link
Contributor

ReneTC commented Dec 22, 2020

I think this issue will be solved once skia is implimented #212

@yonghuming
Copy link
Author

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

@yonghuming
Copy link
Author

skia use glfw

@tushar5526 tushar5526 mentioned this issue Jul 16, 2022
27 tasks
@tushar5526
Copy link
Member

You can try the new experimental renderer or visit #357. I tried the above example and it runs fine for skia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants