A Benchmarking Story: Go, Elixir, and a 3500x speedup
HTML-код
- Опубликовано: 13 июн 2024
- Buckle up, we hit a lot of practical topics in this one. This is the story of how I implemented a small solution in Go and Elixir and how that led me down a benchmarking rabbithole. Topics covered: Go, Elixir, Benchmarking in both languages, some basic datastructures and algorithms troubleshooting, and using benchmarks as a kind of flashlight so I can see what effect my changes are having on performance.
0:00 The problem
3:11 Go code explanation
8:17 Elixir code explanation (maybe this can be a separate video?)
13:05 Go Benchmark
14:43 Go Benchmarking Code Walkthrough
15:57 Elixir Benchmark 1
17:05 Elixir Benchmarking Code Walkthrough
18:19 Elixir vs. Go Speed, unoptimized
19:10 WTF is going on
22:00 Solution - Elixir Dynamic Arrays
24:56 Elixir vs. Go, round 2
26:18 What I learned
29:00 a crazy idea
I know the font is too small, sorry about that. Next one will have a giant font that my grandmother could read.
The repo is here: github.com/groovemonkey/go-el... - Наука
Do more videos in general. They are helpful in more than one way.
I used to say that college professors come in two flavors: those who know the tools and those who got the stories. The first kind keeps you on track to learn a tool that you will (might) need in your work. The second time will tell you stories from the field and inspire you to get there (often at the cost of a lab time).
You seem to have enough experience to share some IT related technical stuff as well as stories associated with them. It is very valuable to the community in general. It doesn't have to be expert opinion, just a log of your journey that we can learn from and get some entertainment out of.
Sorry for the smallish font -- next time I'll bump that way up. Here's the code if you want to explore/benchmark/improve it yourself: github.com/groovemonkey/go-elixir-benchmark
Absolutely would love to see some projects! Also great to see you trying out Neovim!
Yeah, I'm pumped about doing some programming projects, thanks! And yeah, I became addicted to neovim pretty hard about 4 months ago. I'd been casually using vim keybindings in other places but finally got serious about it this year and it's really paid off.
still here at the end buddy. Do the projects!
Nice video! What's your editor's theme?
From your neovim podcast! I am in the process of switching from vsc to nvim. How about you make a video as well about nvim and your workflow?
Awesome, working on it now!
Would love some go projects!
I wonder if you could build it radically different, when you start a new RandomWord module in Elixir you could spawn an Agent process (very cheap in BEAM) with the shuffled list of words and every time you take the word out you simply pop the front most items from the agent keeping the rest of the shuffled in memory.
Forget this, I tried with agent and `shuffle` was a huge bottleneck in hindsight. Might be better off keeping the "length" as a state and just do random number generator with Map.get access instead
Hi man I don't visit you channel for a while how you become go developer if I am not wrong you was as DevOps in past? Why you start to code on Go?
As go developer what you thing about specially in the comparison with python? I mean about syntax, ease of coding, code support?
still here :)
GO GO GO!
nice,
As I remember you have had several videos promoting Emacs as the best editor,and now you are using neovim,have you changed your mind.
so Go is faster than Elixir.
Naturally