What is the state of p5.js and bugs

Hi!

I'm browsing for a JavaScript graphics library for a project for audience interaction using a web page on a smartphone and ran into p5.js. However, it seems like while some of the pages in the Gallery works on my phone (Fairphone2, Android 5.1) none of the examples do. Some of the sketches, like the front page of p5js.org, are very slow even on my desktop. I guess my question is, is p5.js ready for production?

Cheers!

Answers

  • It depends on exactly what you mean by production. P5.js does a lot of things very well. But JavaScript on mobile (especially Android (and I say that as a fan of Android)) is notoriously slow. If you really need this to run on a phone, you're probably going to hit a lot of problems. That's not a problem with P5.js. That's a problem with mobile devices and JavaScript in general.

  • I see. Maybe this is the wrong place to ask, but if I need my page to run on mobile (and be really really sturdy), should I turn to javascript game libraries like Phaser.io and use less intense graphics until JS on phones gets better?

  • The best thing you can do is just try different things out and do some profiling. But the simple fact is that phones are slower than desktop computers, so any processing-intensive JavaScript is going to cause problems. I doubt switching to a different JavaScript framework is going to work any miracles, but the best thing you can do is try it out.

    You could also try some naive fixes on P5.js: lower the framerate, lower the resolution, etc. None of that is particular to P5.js though.

  • Of course that is generally true, my concern was that since p5.js is still in beta and since the examples didn't show up at all on mobile, that there are larger compatibility issues that have not yet been adressed in p5.js, compared to paper.js (whose examples do work) or Phaser.io. Perhaps nothing so general can be said and I just have to dig down and be prepared to rewrite...

  • edited September 2016

    Do none of them work at all, or are they just slow? The examples seem to (slowly) work for me, even on my ancient Galaxy Nexus.

    Where do you see that P5.js is beta?

    But yeah, I doubt there's a general rule here, but you can look at the P5.js GitHub for known issues. Here is an issue that mentions a potential fix for framerate problems.

  • edited September 2016

    Thanks! None of them work at all, all I get is a white box, and my phone is running Chrome 52. I hesitate to file a bug report on the p5.js github because this might have more to do with the p5js.org website... I want p5.js to work (because of Processing's legacy as one of the go to languages for live visuals), so I'll just try it out and see what happens.

  • Oh, and it says Beta on the p5.js logo on the website :)

  • Oh, and it says Beta on the p5.js logo on the website

    You are much more observant than I am!

    I think the answer is in GoToLoop's links. P5.js uses a few features that aren't supported by every browser.

    Does mobile Chrome have developer tools? Could you access the JavaScript console on your device to see any errors you're getting?

  • The thing is my browser is on the supported list. I might have a go at remotely debugging the page tomorrow as the mobile version doesn't include developer tools.

  • Just my opinion but I wouldn't use p5 on production: not stable enough and performance of established libraries is better. For 2D without game mechanics try pixiJS; though as KW says you will need to do testing to establish how well stuff performs on mobile. IIRC you can hook your Android phone up to a PC and run the Chrome dev tools from there: v useful for debugging...

Sign In or Register to comment.