chrfrasco
Good advice, I think the useful idea is: An excellent product in competition with a very good incumbent is a bad idea. A mediocre product in competition with an absent or terrible incumbent is a great idea
For many CLIs I think even a brain-dead bump allocator would work
https://www.typescriptlang.org/play?#code/C4TwDgpgBAygrgWygX...
What’s the difference between a Rust char and a Go rune?
I suppose I wasn't so interested in figuring out how to make this algorithm as fast as possible as much I was interested in diving into why this particular implementation was slower.
I'm not totally convinced that this difference is down to the string being parsed over and over, though
> doing the UTF-8 decoding up-front is exacerbating the performance difference in the allocator
This seems to suggest that allocation might be dominating here. WDYT? Either way, I've added a disclaimer to the post.
The one-two combo of 1) better performance on linux & 2) jemalloc seeming to fix the issue lured me into believing that the allocator was to blame. I’m not sure what the lesson here is – perhaps more proof of Cunningham’s law? https://en.wikipedia.org/wiki/Ward_Cunningham#Cunningham's_L...
I tried this. Pulling the .chars() call out of the loop & collecting into a Vec made the performance even worse – the following balloons the runtime from ~2.7s to ~5s:
let target_chars: Vec<char> = target.chars().collect();
for (i, source_char) in source.chars().enumerate() {
let mut next_dist = i + 1;
for (j, target_char) in target_chars.iter().enumerate() {
> written mindlessly
> incompetence of the personNo challenge there :P I am operating under the assumption that I don't need to understand how compilers work to get good performance from rust (where good is "similar enough to an equivalent go program")
cache := make([]int, len(targetChars)+1)
for i := 0; i < len(targetChars)+1; i++ {
cache[i] = i
}
AFAIK this makes them equivalent (fingers crossed). It seems to not have made much of a difference (-0.03s)Making Rust as Fast as Go
Is Mobx Magic?
Show HN: A utility for printing paths from stdin as a tree
Writing Python with (almost) no statements using the walrus operator
You're funny!
fizzbuzz = lambda n: [print((“fizz” * m % 3 == 0) + (“buzz” * m % 5 == 0) or m) for m in range(n)]
Not sure if this is great or terribleGitHub Game of Life – Play Conway's Game of Life with Your Contributions Graph
Ask HN: How can I prevent myself from being pigeon-holed?
I'm about 6 months away from graduating university (compsci + stats). I've also been working as a front end developer for about 1.5 years.I do enjoy my work but I'm worried about not being able to get jobs in other domains. How can I avoid this? Is this even something to worry about?