File:Implementing and Optimizing a Wordle Solver in Rust.webm

Summary

Description
English: We implement a Wordle solver in Rust based off on the excellent

3blue1brown video on the same topic: https://www.youtube.com/watch?v=v68zYyaEmEA

And then we profile and optimize it to improve the runtime from our initial naive implementation by ~13500x. You can find the code at https://github.com/jonhoo/roget.

0:00:00 Introduction 0:01:00 Wordle intro 0:04:50 What we're doing today 0:11:24 Gathering our datasets 0:27:22 Structure the solver 0:44:04 The correctness of a guess 1:14:28 Testing the play machinery 1:30:16 Outlining the algorithm 1:38:55 Does a word match a pattern? 2:21:12 Reusing correctness computation 2:26:06 Computing a word's "goodness" 2:49:20 Running the naive implementation 2:57:59 Profiling to the rescue 3:04:44 Avoiding allocations 3:22:05 Comparing bytes, not characters 3:31:58 Correctness computing is faster 3:42:23 HashMap iteration is slow 3:47:40 Compare bytes again 3:50:20 Trying to avoid bounds checks 3:54:42 Keep words as length 5 arrays 4:07:36 Only initialize remaining once 4:21:00 Back to length 5 arrays 4:32:14 Where is compute spending time? 4:51:20 Short break 4:55:20 What if we don't set the first word? 5:02:49 What if we start with another word? 5:07:15 Precalculating matches 5:31:20 Prefer more likely words 5:38:05 Prune known-empty patterns 5:56:24 Don't even consider unlikely words 6:07:36 Closing thoughts

Live version with chat: https://www.youtube.com/watch?v=cfjQw4ZjAiI
Date
Source YouTube: Implementing and Optimizing a Wordle Solver in Rust – View/save archived versions on archive.org and archive.todayCategory:Media from YouTube
Author Jon Gjengset

Licensing

This video, screenshot or audio excerpt was originally uploaded on YouTube under a CC BY license.
Their website states: "YouTube allows users to mark their videos with a Creative Commons CC BY license."
To the uploader: You must provide a link (URL) to the original file and the authorship information if available.
w:en:Creative Commons
attribution
This file is licensed under the Creative Commons Attribution 3.0 Unported license.
Attribution:
Jon Gjengset
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
Category:CC-BY-3.0#Implementing%20and%20Optimizing%20a%20Wordle%20Solver%20in%20Rust.webm
Category:Media from YouTube#Implementing%20and%20Optimizing%20a%20Wordle%20Solver%20in%20Rust.webm
This file, which was originally posted to an external website, has not yet been reviewed by an administrator or reviewer to confirm that the above license is valid. See Category:License review needed for further instructions.
Category:License review needed (video)#153342383 Category:Uploaded with video2commons Category:Videos of Rust (programming language)
Category:CC-BY-3.0 Category:License review needed (video) Category:Media from YouTube Category:Uploaded with video2commons Category:Videos of Rust (programming language)