# Rust / Julia Comparison Post

**URL:** <https://discourse.julialang.org/t/rust-julia-comparison-post/75403>\
**Category:** Performance\
**Tags:** rust\
**Created:** [January 29, 2022, 1:45am UTC](https://discourse.julialang.org/t/rust-julia-comparison-post/75403 "2022-01-29T01:45:37Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![Vasily\_Pisarev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vasily_pisarev/32/7929_2.png) [@Vasily\_Pisarev](https://discourse.julialang.org/u/Vasily_Pisarev)\
**Post date:** [January 29, 2022, 3:23pm UTC](https://discourse.julialang.org/t/rust-julia-comparison-post/75403/16 "2022-01-29T15:23:36Z")

</div>

I’ve implemented the following optimizations, ranked by the improvement they make:

1. (This is a bugfix, rather) Concatenation instead of destructive extension of `words`: `allowed_guesses = [words; non_solution_words]` (4700 min → 150 min)
2. Using `NTuple{5, UInt8}` instead of `String` to store and rank words (thanks to @GunnarFarneback for the idea) (150 min → 20 min)
3. Using `Int8` for `index` in the `Constraint` struct (20 min → 15 min)
4. Removing non-`const` globals (no noticeable effect)

Github gist:  
[https://gist.github.com/vvpisarev/9da868c876ae01ed801ce97d7440218f](https://gist.github.com/vvpisarev/9da868c876ae01ed801ce97d7440218f)

The offered choices seem to match those on the author’s website, so it looks like concatenation is what the author did have in mind writing the `append!`.

---

_[View the full topic](https://discourse.julialang.org/t/rust-julia-comparison-post/75403)._
