HN user

trishume

4,753 karma

I program things and blog about them. http://thume.ca/ http://github.com/trishume tristan@thume.ca

Posts41
Comments428
View on HN
thume.ca 2y ago

All my favorite tracing tools

trishume
355pts40
thume.ca 3y ago

Production Twitter on one machine? 100Gbps NICs and NVMe are fast

trishume
776pts477
thume.ca 3y ago

My DIY ergonomic travel workstation with aluminum and magnets

trishume
215pts89
blog.janestreet.com 4y ago

Magic-trace: Diagnose tricky performance issues with Intel Processor Trace

trishume
170pts18
thume.ca 5y ago

Implicit In-order Forests: Zooming a billion trace events at 60fps

trishume
175pts24
thume.ca 5y ago

Implicit In-order Forests: Zooming a billion trace events at 60fps

trishume
16pts1
thume.ca 5y ago

Hard to discover tips and apps for macOS

trishume
346pts229
thume.ca 5y ago

Reverse engineering an AI spaceship game at DEF CON CTF

trishume
2pts0
thume.ca 5y ago

My tier list of interesting YouTube channels

trishume
5pts0
thume.ca 6y ago

Fragile narrow laggy asynchronous mismatched pipes kill productivity

trishume
264pts86
thume.ca 6y ago

Teleforking a Process onto a Different Computer

trishume
572pts132
thume.ca 6y ago

Shenanigans with Hash Tables

trishume
4pts1
thume.ca 6y ago

Two Performance Aesthetics: Never Miss a Frame and Do Almost Nothing

trishume
8pts0
thume.ca 7y ago

Models of Generics and Metaprogramming: Go, Rust, Swift, D and More

trishume
81pts6
thume.ca 7y ago

Comparing the Same Project in Rust, Haskell, C++, Python, Scala and OCaml

trishume
783pts370
thume.ca 7y ago

Writing a Compiler in Rust

trishume
3pts0
raphlinus.github.io 8y ago

Smooth Resize in Direct2D

trishume
3pts0
github.com 8y ago

Enfasten: Automatically make your site faster with optimized responsive images

trishume
2pts0
thume.ca 9y ago

Things I've Learned Doing Internships

trishume
4pts1
thume.ca 9y ago

Disassembling Sublime Text

trishume
419pts144
thume.ca 9y ago

Designing and Building a Keyboard: The Body

trishume
1pts0
medium.com 10y ago

Graal and Truffle could radically accelerate innovation in programming languages

trishume
26pts5
lbstanza.org 10y ago

Stanza: a new optionally-typed general-purpose programming language

trishume
44pts20
www.noteslate.com 10y ago

Noteslate

trishume
92pts70
thume.ca 10y ago

Magic PNG Thumbnails

trishume
111pts41
thume.ca 11y ago

Designing and Building a Keyboard: The Body

trishume
2pts0
thume.ca 12y ago

Hacking Math Homework

trishume
5pts1
thume.ca 12y ago

Typing Faster

trishume
1pts0
tristan.hume.ca 13y ago

Play Ultimate Tic-Tac-Toe Against an AI

trishume
2pts2
browny-amiga.livejournal.com 13y ago

X2Go: Remote Desktop so Fast it Seems Local

trishume
5pts2

I haven't actually used bpftrace myself, only BCC. I can totally imagine it being more janky than DTrace, BCC is pretty janky even if I also think it's cool. In my eBPF tracing framework I had to add special handling counters to alert you if it ever lost any events, plausible bpftrace didn't do that.

Do you know of anyone who's built that kind of time travel debugging with a trace visualization in the open outside of Javascript? I know about rr and Pernosco but don't know of trace visualization integration for either of them, that would indeed be very cool. I definitely dream of having systems like this.

To me most interesting are factors I didn't consider in features I did cover. Next most interesting are features I didn't cover which are kinda core to Twitter being good, and also pose interesting performance problems, like the person who mentioned spam/abuse detection. After that are non-core features which pose interesting performance problems that are different from problems I already covered.

The comments that I think aren't contributing much are ones that mention features that I didn't cover but make no attempt to argue that they're actually hard to implement efficiently, or that assert that because I didn't implement something it isn't feasible to make as fast as I calculate, without arguing what would actually stop me from implementing something that efficient. Or ones who repeat that this isn't practical, which I say at length in the post.

That's really cool! Each year of historical images I estimate at 2.8PB, so it would need to scale quite far to handle multiple years. How would you actually connect all those external drive chassis, is there some kind of chainable SAS or PCIe that can scale arbitrarily far? I consider NVMe-over-fabrics to be cheating and just using multiple machines and calling it one machine, but "one machine" is kinda an arbitrary stunt metric.

I have fantasized about doing this as a startup, basically doing cache coherency protocols at the page table level with RDMA. There's some academic systems that do something like it but without the hypervisor part.

My joke fantasy startup is a cloud provider called one.computer where you just have a slider for the number of cores on your single instance, and it gives you a standard linux system that appears to have 10k cores. Most multithreaded software would absolutely trash the cache-coherency protocols and have poor performance, but it might be useful to easily turn embarrassingly parallel threaded map-reduces into multi-machine ones.

I think I'm pretty careful to say that this is a simplified version of Twitter. Of the features you list:

- spam detection: I agree this is a reasonably core feature and a good point. I think you could fit something here but you'd have to architect your entire spam detection approach around being able to fit, which is a pretty tricky constraint and probably would make it perform worse than a less constrained solution. Similar to ML timelines.

- ad relevance: Not a core feature if your costs are low enough. But see the ML estimates for how much throughput A100s have at dot producting ML embeddings.

- web previews: I'd do this by making it the client's responsibility. You'd lose trustworthiness though so users with hacked clients could make troll web previews, they can already do that for a site they control, but not a general site.

- blocks/mutes: Not a concern for the main timeline other than when using ML, when looking at replies will need to fetch blocks/mutes and filter. Whether this costs too much depends on how frequently people look at replies.

I'm fully aware that real Twitter has bajillions of features that I don't investigate, and you couldn't fit all of them on one machine. Many of them make up such a small fraction of load that you could still fit them. Others do indeed pose challenges, but ones similar to features I'd already discussed.

Which I think I'm perfectly clear about in the blog post. The post is mostly about napkin math systems analysis, which does cover HTTP and HTTPS.

I'm now somewhat confident I could implement this if I tried, but it would take many years, the prototype and math is to check whether there's anything that would stop me if I tried and be a fun blog post about what systems are capable of.

I've worked on a team building a system to handle millions of messages per second per machine, and spending weeks doing math and building performance prototypes like this is exactly what we did before we built it for real.

I agree most HTTP server benchmarks are highly misleading in that way, and mention in my post how disappointed I am at the lack of good benchmarks. I also agree that typical HTTP servers would fall over at much lower new connection loads.

I'm talking about a hypothetical HTTPS server that used optimized kernel-bypass networking. Here's a kernel-bypass HTTP server benchmarked doing 50k new connections per core second while re-using nginx code: https://github.com/F-Stack/f-stack. But I don't know of anyone who's done something similar with HTTPS support.

Quote tweets I'd do as a reference and they'd basically have the cost of loading 2 tweets instead of one, so increasing the delivery rate by the fraction of tweets that are quote tweets.

Hashtags are a search feature and basically need the same posting lists as for search, but if you only support hashtags the posting lists are smaller. I already have an estimate saying probably search wouldn't fit. But I think hashtag-only search might fit, mainly because my impression is people doing hashtag searches are a small fraction of traffic nowadays so the main cost is disk, not sure though.

I did run the post by 5 ex-Twitter engineers and none of them said any of my estimates were super wrong, mainly just brought up additional features and things I didn't discuss (which I edited into the post before publishing). Still possible that they just didn't divulge or didn't know some number they knew that I estimated very wrong.

My friend mentioned this just before I published and I think that probably is the fastest largest thing you can get which would in some sense count as one machine. I haven't looked into it, but I wouldn't be surprised if they could get around the trickiest constraint, which is how many hard drives you can plug in to a non-mainframe machine for historical image storage. Definitely more expensive than just networking a few standard machines though.

I also bet that mainframes have software solutions to a lot of the multi-tenancy and fault tolerance challenges with running systems on one machine that I mention.

I specifically assumed a max tweet size based on the maximum number of UTF-8 bytes a tweet can contain (560), with a link to an analysis of that, and discussion of how you could optimize for the common case of tweets that contain way fewer UTF-8 bytes than that. Everything in my post assumes unicode.

Oooh nice! Your Kyria posts are actually where I first learned about how awesome and cheap SendCutSend is, and got some of the inspiration for the magnets.

I actually ordered a plain steel plate first, but I realized that given that I needed them in a different position to travel compactly than the wide position I like for typing, I wanted them to snap in consistent positions so it wasn't finicky to line up exactly how I liked them.

The latency numbers they state seem achievable or beatable with Infiniband, Amazon's EFA, or TCPDirect. 2us round-trip is achievable for very simple systems. If this kind of networking sounds good to you, you can buy it today! It's even available on AWS, Azure and Oracle Cloud (but not GCP yet AFAIK).

This is a really cool example of tree diffing via path finding. I noticed that this was the approach I used when I did tree diffing, and sure enough looks like this was inspired by autochrome which was inspired by my post (https://thume.ca/2017/06/17/tree-diffing/).

I'm curious exactly why A* failed here. It worked great for me, as long as you design a good heuristic. I imagine it might have been complicated to design a good heuristic with an expanded move set. I see autochrome had to abandon A* and has an explanation of why, but that explanation shouldn't apply to difftastic I think.

Have you seen my Xi CRDT writeup from 2017 before? https://xi-editor.io/docs/crdt-details.html

It's a CRDT in Rust and it uses a lot of similar ideas. Raph and I had a plan for how to make it fast and memory efficient in very similar ways to your implementation. I think the piece I got working during my internship hits most of the memory efficiency goals like using a Rope and segment list representation. However we put off some of the speed optimizations you've done, like using a range tree instead of a Vec of ranges. I think it also uses a different style of algorithm without any parents.

We never finished the optimizing and polished it up, so it's awesome that there's now an optimized text CRDT in Rust people can use!

This is awesome. In theory you could absolutely minimize the latency penalty to just the overhead of the gpu1->memory->gpu2 copy, if the display sync signals from the display the passthrough window was on were passed through to the GPU driver on Windows, and that was combined with fullscreen compositor bypass (available on many Linux WMs) or low-latency compositing (available on sway and now mutter https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1762 on Wayland).

I really hope we get more technical information on how Lumen and Nanite work, and additionally that Epic doesn't patent the techniques in either of them. A patent on either would make me so sad, 20 years is really long in software, absent Epic's amazing work I expect we would have something else like it in like 3 years given what we've seen in things like http://dreams.mediamolecule.com/.

Standard Fenwick trees can only do prefix sums, which only get you general range queries on things with a subtraction operator, not operations like maximum.

The reddit comment I link contains an implementation that allegedly does arbitrary range queries, but it's nigh-incomprehensible so I can't tell how or why it uses 3 arrays.

Cool! I thought about using skip lists a bunch before I settled on this, trying to think of various ways to reduce complexity and memory usage. My best skip lists designs still had some pointer overhead that the implicit approach avoids, but it was pretty small and they seemed reasonably simple. I briefly tried thinking of what an implicit skip list would be, but then just ended up thinking about implicit search trees.

Yah mipmaps are an N-dimensional generalization of the breadth first layout of implicit aggregation, where the aggregation function is averaging.

It may in theory be possible to generalize the in-order layout I talk about in a similar way, but I'm not sure it would be that useful, maybe it would allow you to append rows or columns to your mipmapped image more easily, but I don't know of any applications where that's useful.

My suggestion would be to automatically add submissions of unique posts to the second chance pool or have a reviewer look at them when they're for a domain or user with a high hit rate but fall off new. I'm mostly thinking about technical blogs with consistent article quality like https://news.ycombinator.com/from?site=ciechanow.ski , https://news.ycombinator.com/from?site=raphlinus.github.io and https://news.ycombinator.com/from?site=scattered-thoughts.ne...

I'm biased on this though, as someone this might impact (https://news.ycombinator.com/from?site=thume.ca). From talking to other technical bloggers the consensus does seem to be that when we put a lot of effort into a technical article it nearly always makes it to the top of https://lobste.rs/ and /r/programming because it starts on the front page there but will sometimes flop off new on HN and maybe only make it months later if someone else resubmits the post.

I wish they actually gave latency statistics instead of just saying "we worked really hard don't worry about it".

There's definitely potential to do well on latency, if for example you have a server in NYC and your client has FIOS the inherent network latency could be 3ms and the only challenge is the encode/decode latency. It's possible Mighty has done something better, but every other remote desktop system I've tested spends more time on encode/decode than in the network, while claiming they're great (without giving numbers).

If you have figured out encode/decode latency, show me a high speed video (including the user's hands, not a screen recording) of say a Macbook on residential internet in NYC separate from your servers clicking things, compared to that Macbook running Chrome locally. Your numbers will almost certainly be worse for local interactions like typing in a text box, but you can show how it's better for things like clicking links.

Another issue other desktop streaming systems have is that video compression makes text ugly, especially when scrolling. This isn't as big of a deal for the game streaming systems but is noticeable on a retina display desktop. It's plausible Mighty has the codec settings cranked up enough so this isn't an issue though.

How Safe Is Zig? 5 years ago

Zig is a C-like language that isn't memory safe. A UAF bug looks the same as it does in C where you manually call the allocator to get a block of memory, manually free it, then try to perform an access via a pointer to it.

If they raised prices they'd still make more money, rather than the money going to scalpers, and they could offer TSMC more money for more fab time, which TSMC could take into account when planning future fabs.

As far as I can tell the reason they don't raise prices is that the PR hit they'd take from all the gamers hating them for it would be a bigger deal than the additional revenue.

My impression is that what kind of parallelism patterns you need is pretty consistent within entire fields of programming. So you can go an entire career of performance optimization within HPC, game dev, film rendering or trading systems and never use the patterns the others say they use all the time.

My experience with process-based parallelism is that yes on Linux it's basically isomorphic to thread-based parallelism. It's just so much more code to do the same thing.

In Rust adding a new special-purpose background thread with some standard-library channels is 30 lines of code and I can probably even access the same logging system from the other thread.

If I wanted to do that with processes I need to:

- Coordinate a shared memory file over command line arguments or make sure everything is fork-safe

- Find a library for shared-memory queues

- Deal with making sure that if either process crashes the other process goes down with it in a reasonable way.

- Make sure all my monitoring/logging is also hooked up to the other process.

If I want to use a shared memory data-structure with atomics I need to either not use pointers or live dangerously and try and memory-map it at the exact same offsets in each process and ensure I use a special allocator for things in the shared file.

Yes you can do all the same things with both approaches, I just find threads take way less code. It's not too bad if all your processes are doing the same thing, and you also need to scale to many servers anyhow. It's more annoying if you want to have a bunch of different types of special background processes.