Update atbash cipher (doc, doctest, performance)#2017
Conversation
cclauss
left a comment
There was a problem hiding this comment.
Running performance benchmarks...
> atbash_slow() 18.921338292999998 seconds
> atbash() 16.922152821999997 seconds
How could atbash() be modified to be much faster?
|
With small string speed is not visible - even worse. I've tried with 4 000 000 characters length and current implementation is little bit faster (from 3.2 sec -> 2.2 - 2.4 sec). That's why I wrote "little" in PR description :) I can put some performance tests I made If you want :) |
I thought about modulo operations and remove completely searching characters in |
|
Would it help if we moved the definition of |
Perhaps but insignifficant, these strings are too small. The bottleneck is here: |
* Update atbash * Add benchmark() to quantify the performance improvement Co-authored-by: Christian Clauss <cclauss@me.com>


Describe your change:
Added update for atbash cipher:
Checklist:
Fixes: #{$ISSUE_NO}.