Not sure about Java mode because that uses Java AWT to draw graphics but in P2D and P3D the underlying renderer is OpenGL.
Now OpenGL is optimized to draw render images using triangles and is much slower rendering lines so rendering any shape with a stroke will be significantly slower than a shape with noStroke.
I am not sure about circle because OpenGl can represent circles and ellipses as a series of connected triangles (TRIANGLE_FAN) but I don’t know how Processing implements circle and ellipse.
Thanks.
I’ve begun replacing point() with square() in my sketches wherever possible and needed, the gain in speed is huge.
I’ve tried the same with Processing for Android, it’s still faster but barely.
It’s because the point is not really a “point”. It’s a small mesh that is oriented to face the camera.
If you are drawing square points, the mesh is a quad, or two triangles. If you are drawing round points, the mesh is a set of triangles that share one vertex.
When Processing (P2D or P3D) draws a square point, it is the same number of triangles as when it draws a quad (rectangle). When it draws a round point, it is about the same number of triangles as a circle.
There are other details that can affect performance, such as when you use beginShape(POINTS) and repeatedly call vertex() vs calling point() repeatedly. These issues are secondary to the above issue though.
The downside of using square(x, y, 1) is that you have to make sure the squares are oriented towards the camera. If you look at the square from a shallow angle, you won’t see anything.
If you need round points and also need performance, you can draw square points but then use a shader to make them look round.