processing / processing/p5.js

get() and/or pixelDensity() lag since v1.8.0

Open
#7,061 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Topic

This is pretty odd issue – but ever since p5.js version 1.8.0 was released, nearly all of my previous sketches which experiment with visual feedback, using get() (especially when combined with pixelDesnity() for upscaling images) – slowed to a halt (even on an M1 Max). I know some significant changes happened to both of these functions in that release, and that there were some sizing issue that got cleared up, however is there a chance an accidental bug still exists in the updates that is causing this?

Example:
https://editor.p5js.org/ffd8/sketches/r367LzyK7

  • toggle on v1.9.2 and uncomment line 4, prod = 10 – which lags out on my M1 Max, however with v1.7.2 (or any version prior) it works just fine.

Sure, this is using pixelDensity() in a weird way – but these sketches worked fine on a mobile phone with normal pixelDensity(), however if I try updating to later versions, they also lag out... so I believe the issue is with get().

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 with the linked p5.js Editor sketch, toggle to v1.9.2, and uncomment line 4 with prod = 10; compare it against v1.7.2 and earlier versions. Investigate the interaction between get() and pixelDensity(), and consider the issue complete when the regression is identified and the visual-feedback sketch no longer lags in affected versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.