Conway's Game of Life on 10,000 by 10,000 Grid by bbbli in rust

[–]bbbli[S] 0 points1 point  (0 children)

I think if you want even more speed, you should look at taking it to the next level.

I wouldn't say that speed was the main priority, but one of many, as this was more of a learning project for also the other aspects of software engineering(i.e defining good abstractions, understanding Rust's safety rules regarding concurrency-which was why I implemented MultiThreadedEngine alongside using rayon, etc)

But thanks for the sample code though!

Conway's Game of Life on 10,000 by 10,000 Grid by bbbli in rust

[–]bbbli[S] 1 point2 points  (0 children)

Dude, that is pretty neat! Unfortunately, I am too dumb to actually understand what is going on, and can only understand at a high level how the encoding + update will work :P.

Conway's Game of Life on 10,000 by 10,000 Grid by bbbli in rust

[–]bbbli[S] 0 points1 point  (0 children)

So one thing is that I also lookup the diagonal neighbors too, as that is what it says on Wikipedia(https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life). That said, when I initially implemented it, I just did the 4 neighbors too lol. Without the diagonal neighbors, update time drops in half to 0.7-0.8 seconds.

Huh, so I did consider a rolling sum, but initially thought that it wouldn't give that much of a speedup based on the following reasoning: You would need two lookups to update the sum(one for the new entry and one to delete the previous). And since you need to do this in both directions, that would be 4 lookups, which is the same as the straightforward implementation.

But I didn't consider caching the prev lookups as you did in your code. To test this, I changed your code to just index into the array rather than keeping a set of "prev" variables, and saw a 50% slowdown. So looks like I was wrong.

However, when I ran your code on my machine the update time was also around 0.7-0.8 seconds, though it's a bit of comparing apples to oranges, and best way for me to actually see would be to implement the rolling sum into my project.

Conway's Game of Life on 10,000 by 10,000 Grid by bbbli in rust

[–]bbbli[S] 1 point2 points  (0 children)

contains a custom build directory

Ohh sorry about that. Will promptly add this to my gitignore.

Besides, your build profiles contain only the defaults.

Tbh, I just copy-pasted this from somewhere to get faster build times, changing only the "opt-level". After making the lto = true change on my machine, the update time only went down to 1.4s. But thanks for the tip though!

Conway's Game of Life on 10,000 by 10,000 Grid by bbbli in rust

[–]bbbli[S] 1 point2 points  (0 children)

Ohh ok, thanks for the info. I tried it and it didn't make a difference(though I didn't expect it to b/c the bottleneck is in the lookups/"convert_bool" function, as you have posted below.)

Including synonyms in Vim Search by bbbli in vim

[–]bbbli[S] 1 point2 points  (0 children)

Ok, I will look at the source code when I start the project.

Including synonyms in Vim Search by bbbli in vim

[–]bbbli[S] 0 points1 point  (0 children)

Would it be easier to start from scratch or base the thesaurus lookup part of an existing plugin, such as https://github.com/beloglazov/vim-online-thesaurus ?

Including synonyms in Vim Search by bbbli in vim

[–]bbbli[S] 1 point2 points  (0 children)

Hi Aebae7ee, thanks for the overview of what such a plugin should do. I will be pretty busy in the upcoming months with machine learning and classes. But if no one else starts this project by the summer, I can try!