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

Slow since version 1.0 #6743

Open
2 of 17 tasks
peeter2 opened this issue Jan 15, 2024 · 4 comments
Open
2 of 17 tasks

Slow since version 1.0 #6743

peeter2 opened this issue Jan 15, 2024 · 4 comments

Comments

@peeter2
Copy link

peeter2 commented Jan 15, 2024

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

p5.js version

1.9.0

Web browser and version

all

Operating System

all

Steps to reproduce this

The performance is still slow.
I have created a speed test sketch that performs really fast on versions older than 1.0.0. It is very fast on version 0.9.0 for example as in this example:
https://editor.p5js.org/shangtsung/sketches/j080fh87C

And it is very slow on every newer version starting from version 1.0.0 (no matter what browser or device) as you can see when you change p5.js version number in the sketch.

Seems like new version is not always better.
Any idea when this bug will be fixed?

@codevogel
Copy link

I seem to have run into a similar issue.

This sketch seems to run much faster on version <= 1.5.0
https://codepen.io/kemmel-dev/pen/LYvzXqp?editors=1111

@asukaminato0721
Copy link
Contributor

asukaminato0721 commented May 4, 2024

First step is to find out which commit causes the performance to down.

some records

git diff v1.5.0..v1.6.0 --stat
 src/webgl/3d_primitives.js                              |  228 ++++++++++---
 src/webgl/material.js                                   |   21 +-
 src/webgl/p5.Camera.js                                  |   49 +--
 src/webgl/p5.Geometry.js                                |  252 ++++++++++++--
 src/webgl/p5.RenderBuffer.js                            |    7 +
 src/webgl/p5.RendererGL.Immediate.js                    |   41 ++-
 src/webgl/p5.RendererGL.Retained.js                     |    8 +
 src/webgl/p5.RendererGL.js                              |  143 ++++++--
 src/webgl/p5.Shader.js                                  |   18 +-
 src/webgl/p5.Texture.js                                 |   16 +-
 src/webgl/shaders/basic.frag                            |    6 +-
 src/webgl/shaders/font.frag                             |    6 +-
 src/webgl/shaders/font.vert                             |   16 +-
 src/webgl/shaders/light.vert                            |    7 +
 src/webgl/shaders/light_texture.frag                    |   10 +-
 src/webgl/shaders/line.frag                             |   47 ++-
 src/webgl/shaders/line.vert                             |  140 +++++++-
 src/webgl/shaders/normal.vert                           |    6 +
 src/webgl/shaders/phong.frag                            |   10 +-
 src/webgl/shaders/phong.vert                            |    7 +
 src/webgl/shaders/point.frag                            |   30 +-
 src/webgl/shaders/vertexColor.frag                      |    4 +-
 src/webgl/text.js                                       |   24 +-

so

git diff v1.5.0..v1.6.0 -- src/webgl/*

could print the diff

@davepagurek
Copy link
Contributor

davepagurek commented May 5, 2024

This is a tough one for me because on my computers, I don't notice the same slowdown other commenters are seeing (see also #6438, this is possibly a duplicate of the same issue?) Might need some community help bisecting to find the commit.

@davepagurek
Copy link
Contributor

I seem to have run into a similar issue.

This sketch seems to run much faster on version <= 1.5.0
https://codepen.io/kemmel-dev/pen/LYvzXqp?editors=1111

I think this is a separate issue: this one is due to stroke quality being higher in new versions of p5. Turning off strokes makes this sketch run fast again, and this was a known tradeoff we made. A suggestion for p5 2.0 was made to add a low fidelity line rendering option in #6678 (comment) if you're interested!

OP's sketch was having issues even without lines.

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

4 participants