Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
benhoyt
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
benhoyt
2y ago
I just finished "On Writing Well" by William Zinsser. Here's a little blurb I just wrote about it: What a great book! Zinsser uses such crisp, engaging prose. He covers how to write, why to write, and what to write. He uses l
32.
▲
How to implement a hash table in C (2021)
(benhoyt.com)
169 points
by
benhoyt
2y ago
|
41 comments
33.
▲
by
benhoyt
2y ago
I could be wrong, but I think it just goes over the data once. The first loop increments i by 8, so is processing 64 bits at a time. It looks like the second loop only does the remaining few bytes, if any.
34.
▲
by
benhoyt
2y ago
Oops, yes. I'd better not post that yet. Thanks. :-)
35.
▲
by
benhoyt
2y ago
[deleted]
36.
▲
by
benhoyt
2y ago
> People should use AI as a tool, not an oracle There, fixed the title.
37.
▲
by
benhoyt
2y ago
I love free books, but does the website owner have permission from the author to post this there? The copyright notice says, "Copyright © 2018 John K. Ousterhout. All rights reserved. No part of this book may be reproduced, in any form
38.
▲
by
benhoyt
2y ago
I don't find the fixed code "better in every way". The ultra-long names are hard to read, partly because they take up a lot of space and move the important part -- the GetTable() call -- further right: var err error var
39.
▲
by
benhoyt
2y ago
From their docs [1] it looks like they do everything using integers: the amounts are integers in the "minor unit" of currency, for example cents if the currency is dollars. So 1000 means $10.00. In languages like JavaScript where
40.
▲
by
benhoyt
3y ago
I think those are worthwhile criticisms ... right up until you said "Ruby or Python win over Go by any metric except speed". As someone who has written a ton of Python and a ton of Go (and likes both languages), I still prefer Pyt
41.
▲
by
benhoyt
3y ago
I've chatted with Ray (the author of wak -- love the name) a few times about our respective AWK implementations. He's a nice guy and a really thoughtful programmer, and he even found several edge-case bugs in my GoAWK implementati
42.
▲
by
benhoyt
3y ago
It's a second edition, not a new book -- why did you feel deceived? There's a fair bit of restructuring of the first few chapters, and a whole new chapter on exploratory data analysis (which uses the new CSV support) and a bunch o
43.
▲
by
benhoyt
3y ago
Local disk I/O is no longer the bottleneck on modern systems: https://benhoyt.com/writings/io-is-no-longer-the-bottleneck/ In addition, the official 1BRC explicitly evaluated results on a RAM disk to avoid I&
44.
▲
by
benhoyt
3y ago
I think that's true with the JVM, but the fastest Java solutions are using GraalVM and its ahead-of-time compilation mode to avoid startup time. In addition, while "go run" might take 149ms to compile and run a program, a com
45.
▲
by
benhoyt
3y ago
Using Go's profiling tool with its "source" view: I used "go tool pprof -http=: cpu.prof", where cpu.prof was generated by "go-1brc -cpuprofile=cpu.prof -revision=9 measurements.txt".
46.
▲
by
benhoyt
3y ago
For what it's worth, on my machine the simple/idiomatic "baseline" Java solution ( https://github.com/gunnarmorling/1brc/blob/main/src/main/jav... ) takes 2m0s, compared to 1m
47.
▲
by
benhoyt
3y ago
It's a good point, but I believe because of the "-b" option (characters as bytes), using LC_ALL=C doesn't make a difference.
48.
▲
by
benhoyt
3y ago
On my machine the simple/idiomatic "baseline" Java solution ( https://github.com/gunnarmorling/1brc/blob/main/src/main/jav... ) takes 2m0s, compared to 1m45s for my simple Go versi
49.
▲
by
benhoyt
3y ago
Yeah, someone emailed me privately after they'd dug into this. They mentioned that "items[hashIndex]" was a significant source of cache misses. They used "perf record -e cache-misses" and found it was the largest so
50.
▲
by
benhoyt
3y ago
Well, I guess it's more that the standard library doesn't have a cross-platform way to access them, not that memory-mapped files themselves can't be done on (say) Windows. It looks like there's a fairly popular 3rd par
51.
▲
by
benhoyt
3y ago
Oh, I'd missed those solutions, thanks. You guys got way more hard core than I did -- nice work! Looking forward to reading the code for those solutions this week. Update: for reference, Jason Chu's solution ( https://gi
52.
▲
by
benhoyt
3y ago
Unfortunately it doesn't seem to help at all, I think mainly because (at present) Go's PGO basically inlines hot functions, and the important code here is all in one big function.
53.
▲
Go 2016-2019: My transition into management
(ajmani.net)
1 points
by
benhoyt
3y ago
|
0 comments
54.
▲
Go's early growth 2012-2016
(ajmani.net)
1 points
by
benhoyt
3y ago
|
0 comments
55.
▲
Packaging Scrutiny for NixOS
(jnsgr.uk)
31 points
by
benhoyt
3y ago
|
2 comments
56.
▲
by
benhoyt
3y ago
It's funny to learn there's a term for this. It reminds me of something that happened in our church parking lot a couple of years ago. Someone (presumably a neighbourhood kid) had drawn a big black phallus on the nice white-ish co
57.
▲
by
benhoyt
3y ago
They're about to get an S3 replacement, called Tigris (it's a separate company but integrated into flyctl and runs on Fly.io infra): https://benhoyt.com/writings/flyio-and-tigris/
58.
▲
by
benhoyt
3y ago
1. You're right, it's somewhat apples and oranges. However, from what I can tell, that's part of the selling point of Tigris: you get CDN-like features "for free", without having to set up an extra layer like Cloudf
59.
▲
by
benhoyt
3y ago
Author here. I hear what you're saying. However, I tend to write articles like this even without being paid -- for example, I wasn't asked or paid when I wrote about switching my site to Fly.io originally: https://benho
60.
▲
Moving my website from S3 to Tigris, which runs on Fly.io
(benhoyt.com)
2 points
by
benhoyt
3y ago
|
0 comments
More ›