2

Been working on my Rust isspam version and now it's looking like it should again :P

Rust back on top, baby (☞⌐▀͡ ͜ʖ͡▀ )☞

***benchmarking***
Time C: 0.836021900177002
Time Rust: 0.12235116958618164
Time CPP: 0.39263033866882324
Time Borded CPP: 0.6284189224243164
Time Jest Rust: 0.27682042121887207
***end benchmark***

Comments
  • 2
  • 2
    Video proof or never happened.

    /jk
  • 2
    @D-4got10-01 I'm optimizing it a little more before pushing it

    Then you can benchmark it yourself :P
  • 2
    Oh great finally a reason to move from a linear search ;P
  • 1
    I've noticed rust always runs faster on your machine than others' machines

    the benchmarks don't line up with others
  • 1
    @jestdotty Run it for yourself. I'm doing the normal `make benchmark_only`. No funny business
  • 2
    Let me guess… Better thread management?
  • 0
    @Tounai I think it's mostly two things:

    * loops written more low level to optimize codegen

    * /way/ quicker forbidden word check

    Threads also play a role, and I have no idea why rayon is so damn fast, even faster than manual threads pinned to cores

    But I think the forbidden word checker is what really makes it slow. Apart from @jestdotty who uses a trie, the other versions just do a linear search through the list of ~30 words

    I use lexicographically sorted word sublists for each starting char and also store a bitmap of contained string lengths

    So to check whether a string is in the list you look up whether that starting char even has entries, if it does then whether your word length is in the list and then I iterate over the sorted list. If a char value is bigger/smaller I can immediately move to the next string or cancel the search
Add Comment