Skip to content

Commit 47cfff6

Browse files
committed
fix: Links to p5.Vector
1 parent 3e1baad commit 47cfff6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/tutorials/en/how-to-optimize-your-sketches.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ The sketch runs smoothly with fewer particles, so that change seems to solve the
165165

166166
Similarly, I wondered if I needed to simulate the actual laws of physics. In this case, that was important to the project, but for a game, a simplified version of the physics could still work well and greatly improve performance.
167167

168-
I could also try to use memory more effectively by modifying the original [`p5.Vector`](/reference/p5.Vector) objects and avoiding calls to `p5.Vector.copy()`. This kind of change requires care. When you update an object that is used elsewhere in your code, you might cause an inadvertent bug.
168+
I could also try to use memory more effectively by modifying the original [`p5.Vector`](/reference/p5/p5.Vector) objects and avoiding calls to `p5.Vector.copy()`. This kind of change requires care. When you update an object that is used elsewhere in your code, you might cause an inadvertent bug.
169169

170170
A great strategy is to make a change and see how it improves performance using `frameRate()` as a benchmarking tool. If the frame rate drops, you know you have a problem. This also allows you to ensure you have not inadvertently introduced a new bug into the code.
171171

@@ -200,7 +200,7 @@ In my case, I just let the animation run after I clicked record. The profiler ca
200200

201201
![A screenshot of the Bottom-Up tab of the Chrome profiler after having recorded data, displayed in a table. The Self Time, Total Time, and Activity columns are visible, sorted by Self Time descending. The top item is the copy method, accounting for 48.3% of the time.](../images/advanced/chrome-profiler-bottom-up.png)
202202

203-
It looks like I was right about the `collisions()` function, which takes 93.4% of the time. It seems like most of that is taken up by using [`p5.Vector`](/reference/p5.Vector) and its `.copy()` method in that loop. Of course, you will need to have nicely named functions for this tool to be helpful. See the [performance features reference](https://developer.chrome.com/docs/devtools/performance/reference/#:~:text=%23%20The%20Bottom%2DUp%20tab,learn%20how%20to%20select%20portions.) page for complete documentation.
203+
It looks like I was right about the `collisions()` function, which takes 93.4% of the time. It seems like most of that is taken up by using [`p5.Vector`](/reference/p5/p5.Vector) and its `.copy()` method in that loop. Of course, you will need to have nicely named functions for this tool to be helpful. See the [performance features reference](https://developer.chrome.com/docs/devtools/performance/reference/#:~:text=%23%20The%20Bottom%2DUp%20tab,learn%20how%20to%20select%20portions.) page for complete documentation.
204204

205205
Once you are satisfied with your level of knowledge of the different choices available to you, it is time to decide how to improve your code.
206206

0 commit comments

Comments
 (0)