processing / processing/p5.js

WEBGL became extremely slow since p5.js version 1.0.0

Open
#6,438 19 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area:Core Area:WebGL Bug
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

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

No response

Web browser and version

No response

Operating System

No response

Steps to reproduce this
Steps:
  1. Create a speed test using WEBGL, for example here I created random triangles moving around: https://editor.p5js.org/shangtsung/sketches/qMZ_4M4c6
  2. You can see that the shapes move around really slow, the whole browser window becomes very slow. Until I remove the 'WEBGL' from createCanvas(800, 600, WEBGL), then everything moves very fast.
  3. Also everything moves very fast (including when WEBGL is included) in older p5.js versions before 1.0.0.

So something was messed up in p5.js since version 1.0.0 (including the latest version) that made it very slow.

Or am I missing something?

Probably I was missing this library?
https://github.com/davepagurek/p5.buildgeometry

It seems to make this too complicated. Should I switch back to the very old but fast p5.js version or how exactly should I edit my code to make it fast using the latest p5.js?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked p5.js WebGL sketch and comparing its performance with versions before and after 1.0.0, focusing on the createCanvas(800, 600, WEBGL) entry point. A useful result would reproduce the slowdown, identify the regression in the rendering path, and verify comparable movement speed in the latest version.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.