processing / processing/p5.js

Mobile performance

Open
#5,975 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Topic

As p5 sees increased adoption for mobile AR/VR, what can we do to make sure things run more smoothly? Here are a few points to discuss:

  • After https://github.com/processing/p5.js/pull/5802, stroke rendering is a bit heavier than it used to be. Is this a bottleneck? Should we add a NONE stroke cap/join type so that applications targeting mobile can opt out of the extra geometry of higher fidelity strokes?
  • After https://github.com/processing/p5.js/pull/5915, per-stroke colors are used to allow interpolation in the same way fill interpolation works. Is this a bottleneck? Should we offer methods to disable all per-vertex colors for the sake of performance?
  • Drawing the same shape repeatedly would be more efficient if it is cached on the GPU as a p5.Geometry. Is this an optimization that most sketches would benefit from? If so, should we provide an easier way to create these? (https://github.com/processing/p5.js/issues/5393)

In general, it seems like we should do some profiles to get some data on what parts are slowest on mobile in order to decide what approach would help.

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

Review PRs 5802 and 5915 to understand the stroke geometry and per-stroke color changes, then read issue 5393 about caching repeated shapes as p5.Geometry. Profile representative mobile AR/VR sketches to identify the slowest areas; done means the profiling data supports a clearly scoped optimization direction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
mobile-dev, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.