I am working on a series of audio visual projects that I want people to access from a variety of mobile devices. I really love using the p5js Open Processing website in full screen mode (because it is ready to go and I am a novice at best)! My projects take about 5 seconds to load on my phone. My assumption is that loading time will vary depending on the user’s phone?
Or, is it the server that hosts the sketches that slows loading?
What can I do to optimize my load times for mobile devices in addition to optimizing my code? Is Open Processing as fast as it gets? Or, is there another cloud server that I could get my sketches hosted on that would be lightening?
From my experience with Open Processing; What mostly determinate loading and run speed is the processor capacity of the mobile. The difference can really be big. For example in this sketch I had to put a “loading screen” for slow devices, otherwise it would start messed up. On my daughters new iphone it runs really fast.
Thanks for sharing - what a fun sketch! So, I think what I am wondering about is the white screen between clicking the link and getting to a loading screen like yours. When I loaded your sketch with my Mac Laptop 2015, I still had to wait about 5 seconds before your loading screen showed up. Is that period between clicking and getting to your loading a screen controlled by my device or the hosting server?
So what you are saying is that if the code is optimized there should be no lag time in loading?
I guess I am wondering about about the purpose of a load screen if the user still has to wait to see the load screen. Is there a way to program a load screen so it is not bogged down by the rest of the sketch and it shows instantly?
Yes! I was thinking I could persuade Sinan from Open Processing to make an embedded loading screen for sketches in full screen? But, I was wondering if a sketch could be hosted on a super fast cloud server that performed better?
I got some helpful input from Sinan on OpenProcessing about loading times for mobile on server side:
“Loading issue is a little challenging. There are multiple different steps which could be causing the delay (ie. slow internet in general, sketch loading slow, phone being slow on certain actions, file preload), and it is not possible to create a catch all loading message. OpenProcessing servers are relatively fast, so I don’t see it being a server issue.”
Also kind of curious that if sketches are so bogged down on mobile. I have made pure JS games for mobile within browser and have tested it on old devices ( Android 4 ) and really it ran pretty good even the smart TV was able to handle stuff so interesting to see what really is the first hand issue.
Maybe some code optimization could do the trick ?
Now running @noel sketch it super sluggish on my laptop for some reason and I have a pretty beefy machine ! So that strange.
Okay I didn’t know ! But open processing you just host your processing code, I thought it be P5.js so I am curious then does open processing host the project as an applet ?
Maybe converting the sketch to pure P5.js and just hosting the sketches on P5.js because once you make an account there, you are able to save your sketches and can be accessed publicly.
I meant here your internet provider or even router. My sketch (link above) runs really fast on my humble Windows 7 machine. I only used the loading screen for slow mobile devices. The white screen @mnoble is talking about I sometimes get when I have a bad/slow internet connection.
I guess further assistance could be given in code refactoring to speed up the sketches so if you don’t mind could share the sketches or some versions of it so we can help out to see what the issue truly is !