From e59294c192927fab85456f9c7046d4aa818377bc Mon Sep 17 00:00:00 2001 From: Ashelyn Rose Date: Tue, 5 Sep 2023 17:46:01 -0600 Subject: [PATCH] Proofreading changes --- posts/2023-09-05_wasm-game-of-life-2.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/posts/2023-09-05_wasm-game-of-life-2.md b/posts/2023-09-05_wasm-game-of-life-2.md index 515aaf1..531148d 100644 --- a/posts/2023-09-05_wasm-game-of-life-2.md +++ b/posts/2023-09-05_wasm-game-of-life-2.md @@ -147,8 +147,7 @@ void main() { There's a correction factor here (multiplying the value by 255), but that's because my board data had only 0s and 1s in the bytes for indicating an alive or dead -cell. (And on the GPU this kind of data transformation is *very* fast, which is -why I didn't first correct that in Javascript). +cell, and the shader expects that texture value to have a range between 0 and 255 (the range of a byte). The shader also takes two `uniform` parameters for what colors to draw with, so I will show you where those get set: @@ -187,7 +186,7 @@ So I don't know that much about how Webassembly execution is implemented into browsers, but I know enough about actual CPU architectures to make some reasonable inferences. -With that in mind, as I started thinking about more significant algorithm changes +As I started thinking about more significant algorithm changes I could make, I suspected that the largest contributor to time taken in my old algorithm was probably from it taking longer to access the Webassembly linear memory than local or global variables. At an implementation level this could be because @@ -195,7 +194,7 @@ of how the wasm memory relates to the CPU cache, but I didn't really care about \- I was just curious to see if reducing the number of memory operations my algorithm took could provide me more of a speed-up. -I knew I was already pretty inefficient in this areay - my previous algorithm had made ***10 memory calls per cell*** +I knew I was already pretty inefficient in this area - my previous algorithm had made ***10 memory calls per cell*** (8 to check neighbor states, 1 to check the current cell's state, and 1 to store the updated cell's state), so I suspected I could get that much lower.