frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

I made my VM think it has a CPU fan

https://wbenny.github.io/2025/06/29/i-made-my-vm-think-it-has-a-cpu-fan.html
398•todsacerdoti•10h ago•84 comments

Bitcoin's Security Budget Issue: Problems, Solutions and Myths Debunked

https://budget.day/
34•marcbarbosa•1h ago•11 comments

Ask HN: What Are You Working On? (June 2025)

70•david927•3h ago•241 comments

Cell Towers Can Double as Cheap Radar Systems for Ports and Harbors (2014)

https://spectrum.ieee.org/cell-tower-signals-can-improve-port-security
19•transpute•2h ago•15 comments

Modelling API rate limits as diophantine inequalities

https://vivekn.dev/blog/rate-limit-diophantine
30•viveknathani_•2d ago•2 comments

Finding former Australian Prime Minister Tony Abbott's passport number (2020)

https://mango.pdf.zone/finding-former-australian-prime-minister-tony-abbotts-passport-number-on-instagram/
10•guiambros•1h ago•1 comments

Revisiting Knuth's "Premature Optimization" Paper

https://probablydance.com/2025/06/19/revisiting-knuths-premature-optimization-paper/
54•signa11•3d ago•25 comments

Error handling in Rust

https://felix-knorr.net/posts/2025-06-29-rust-error-handling.html
86•emschwartz•3h ago•73 comments

Show HN: Octelium – FOSS Alternative to Teleport, Cloudflare, Tailscale, Ngrok

https://github.com/octelium/octelium
276•geoctl•12h ago•103 comments

Nearly 20% of cancer drugs defective in 4 African nations

https://www.dw.com/en/nearly-20-of-cancer-drugs-defective-in-4-african-nations/a-73062221
22•woldemariam•54m ago•5 comments

4-10x faster in-process pub/sub for Go

https://github.com/kelindar/event
97•kelindar•8h ago•21 comments

Bloom Filters by Example

https://llimllib.github.io/bloomfilter-tutorial/
175•ibobev•12h ago•26 comments

Many ransomware strains will abort if they detect a Russian keyboard installed (2021)

https://krebsonsecurity.com/2021/05/try-this-one-weird-trick-russian-hackers-hate/
178•air7•5h ago•104 comments

Using the Internet without IPv4 connectivity

https://jamesmcm.github.io/blog/no-ipv4/
250•jmillikin•15h ago•110 comments

The Book of Shaders

https://thebookofshaders.com/
4•max_•3d ago•0 comments

The Medley Interlisp Project: Reviving a Historical Software System [pdf]

https://interlisp.org/documentation/young-ccece2025.pdf
76•pamoroso•9h ago•6 comments

Loss of key US satellite data could send hurricane forecasting back 'decades'

https://www.theguardian.com/us-news/2025/jun/28/noaa-cuts-hurricane-forecasting-climate
217•trauco•6h ago•102 comments

Show HN: Rust -> WASM, K-Means Color Quantization Crate for Image-to-Pixel-Art

https://github.com/gametorch/image_to_pixel_art_wasm
21•gametorch•3d ago•2 comments

Raymond Laflamme (1960-2025)

https://scottaaronson.blog/?p=8949
11•stmw•2d ago•1 comments

China Dominates 44% of Visible Fishing Activity Worldwide

https://oceana.org/press-releases/china-dominates-44-of-visible-fishing-activity-worldwide/
39•scubakid•2h ago•16 comments

Several Anker power bank models recalled: Supplier's batteries pose fire hazard

https://www.heise.de/en/news/Fire-hazard-Anker-recalls-several-power-bank-models-also-in-Germany-10463193.html
9•Eduard•50m ago•1 comments

Show HN: A tool to benchmark LLM APIs (OpenAI, Claude, local/self-hosted)

https://llmapitest.com/
28•mrqjr•8h ago•5 comments

Reverse Engineering the Microchip CLB

http://mcp-clb.markomo.me/
18•_Microft•2h ago•3 comments

ZeroRISC Gets $10M Funding, Says Open-Source Silicon Security Inevitable

https://www.eetimes.com/zerorisc-gets-10-million-funding-says-open-source-silicon-security-inevitable/
32•wslh•3h ago•4 comments

Personal care products disrupt the human oxidation field

https://www.science.org/doi/10.1126/sciadv.ads7908
180•XzetaU8•6h ago•129 comments

More on Apple's Trust-Eroding 'F1 the Movie' Wallet Ad

https://daringfireball.net/2025/06/more_on_apples_trust-eroding_f1_the_movie_wallet_ad
819•dotcoma•16h ago•522 comments

Why Go Rocks for Building a Lua Interpreter

https://www.zombiezen.com/blog/2025/06/why-go-rocks-for-building-lua-interpreter/
64•Bogdanp•3d ago•36 comments

Show HN: Sharpe Ratio Calculation Tool

https://www.fundratios.com/
17•navquant•6h ago•6 comments

Show HN: Summle – A little maths Game

https://summle.net
17•kirchhoff•3d ago•6 comments

Honda Joins Space Race by Launching Successful Reusable Rocket

https://www.forbes.com/sites/peterlyon/2025/06/22/as-spacex-explodes-again-honda-successfully-launches-reusable-rocket/
35•saubeidl•2h ago•5 comments
Open in hackernews

4-10x faster in-process pub/sub for Go

https://github.com/kelindar/event
97•kelindar•8h ago

Comments

kelindar•8h ago
This might be useful to some if you need a very light pub/sub inside one process.

I was building a small multiplayer game in Go. Started with a channel fan-out but (for no particular reason) wanted to see if we can do better. Put together this tiny event bus to test, and on my i7-13700K it delivers events in 10-40ns, roughly 4-10x faster than the plain channel loop, depending on the configuration.

zx2c4•6h ago
> about 4x to 10x faster than channels.

I'd be interested to learn why/how and what the underlying structural differences are that make this possible.

MathMonkeyMan•6h ago
I didn't look, but I don't think of channels as a pub/sub mechanism. You can have a producer close() a channel to notify consumers of a value available somewhere else, or you can loop through a bunch of buffered channels and do nonblocking sends.

A different design, without channels, could improve on those.

atombender•4h ago
I prefer to think of channels as a memory-sharing mechanism.

In most cases where you want to send data between concurrent goroutines, channels are a better primitive, as they allow the sender and receiver to safely and concurrently process data without needing explicit locks. (Internally, channels are protected with mutexes, but that's a single, battle-tested and likely bug-free implementation shared by all users of channels.)

The fact that channels also block on send/receive means and support buffering means that there's a lot more to them, but that's how you should think of them. The fact that channels look like a queue if you squint is a red herring that has caused many a junior developer to abuse them for that purpose, but they are a surprisingly poor fit for that. Even backpressure tends to be something you want to control manually (using intermediate buffers and so on), because channels can be fiendishly hard to debug once you chain more than a couple of them. Something forgets to close a close a channel, and your whole pipeline can stall. Channels are also slow, requiring mutex locking even in scenarios where data isn't in need of locking and could just be passed directly between functions.

Lots of libraries (such as Rill and go-stream) have sprung up that wrap channels to model data pipelines (especially with generics it's become easier to build generic operators like deduping, fan-out, buffering and so on), but I've found them to be a bad idea. Channels should remain a low-level primitive to build pipelines, but they're not what you should use as your main API surface.

MathMonkeyMan•4h ago
> Channels should remain a low-level primitive to build pipelines, but they're not what you should use as your main API surface.

I remember hearing (not sure where) that this is a lesson that was learned early on in Go. Channels were the new hotness, so let's use them to do things that were not possible before. But it turned out that Go was better for doing what was already possible before, but more cleanly.

absolute_unit22•5h ago
> High Performance: Processes millions of events per second, about 4x to 10x faster than channels.

Wow - that’s a pretty impressive accomplishment. I’ve been meaning to move some workers I have to a pub/sub on https://www.typequicker.com.

I might try using this in prod. I don’t really need the insane performance benefits as I don’t have my traffic lol - but I always like experimenting with new open source libraries - especially while the site isn’t very large yet

MunishMummadi•2h ago
that's a cool site. you will see me more frequently btw do some tech twitter promos.
hinkley•5h ago
It’s always worth discussing what features were thrown out to get the performance boost, whether it’s fair for those features to impose a tax on all users who don’t or rarely use those features, and whether there’s a way to rearrange the code so that the lesser used features are a low cost abstraction, one that you mostly only pay if you use those features and are cheap if not free if you don’t.

There’s a lot of spinoff libraries out there that have provoked a reaction from the core team that cuts down cost of their implementation by 25, 50%. And that’s a rising tide that lifts all boats.

tombert•5h ago
Interesting, I need to dig into the guts of this because this seems cool.

I'm a bit out of practice with Go but I never thought that the channels were "slow", so getting 4-10x the speed is pretty impressive. I wonder if it shares any design with LMAX Disruptor...

bob1029•3h ago
> I wonder if it shares any design with LMAX Disruptor...

I've recently switched from using Disruptor.NET to Channel<T> in many of my .NET implementations that require inter-thread sync primitives. Disruptor can be faster, but I really like the semantics of the built-in types.

https://learn.microsoft.com/en-us/dotnet/core/extensions/cha...

https://learn.microsoft.com/en-us/dotnet/api/system.threadin...

tombert•2h ago
I've never used Disruptor.NET, only the Java version.

I personally will use traditional Java BlockingQueue for about 95% of stuff, since they're built in and more than fast enough for nearly everything, but Disruptor kicks its ass when dealing with high-throughput stuff.

bob1029•1h ago
The .NET version is compelling because it has a special variant called ValueDisruptor that can take a struct instead of a class. This gives it a big edge in certain use cases:

https://medium.com/@ocoanet/improving-net-disruptor-performa...

minaguib•4h ago
OP: the readme could really benefit from a section describing the underlying methodology, and comparing it to other approaches (Go channels, LMAX, etc...)
karel-3d•3h ago
The actual code and the actual bench is very short.
singron•3h ago
After a brief skim, it looks like this implementation is highly optimized for throughput and broadcasts whereas a channel has many other usecases.

Consumers subscribing to the same event type are placed in a group. There is a single lock for the whole group. When publishing, the lock is taken once and the event is replicated to each consumer's queue. Consumers take the lock and swap their entire queue buffer, which lets them consume up to 128 events per lock/unlock.

Since channels each have a lock and only take 1 element at a time, they would require a lot more locking and unlocking.

There is also some frequent polling to maintain group metadata, so this could be less ideal in low volume workloads where you want CPU to go to 0%.

hinkley•1h ago
Seems that the trick would be detecting if there is a queue building up and dispatching multiple events per lock if so. Double buffering is a common enough solution here. The reader gets one buffer to write to and the writer gets another, and when the read buffer is drained the write buffer is swapped.

For low traffic messages you need only send one message at a time, but if the receiver slows down the sender can avoid resorting to back pressure until the buffer is more than half full.

qudat•2h ago
This is pretty neat, code looks minimal as well. At pico.sh we wrote our own pubsub impl in Go that leveraged channels. We primarily built it to use with https://pipe.pico.sh

https://github.com/picosh/pubsub

With this impl can you stream data or is it just for individual events?

st3fan•2h ago
"Processes millions of events per second" - yes, sure, when there is nothing to process. But that is not representative of a real app.

Add a database call or some simple data processing and then show some numbers comparing between channels or throughput.

I hate these kind of claims. Similar with web frameworks that shows reqs/s for an empty method.

catlifeonmars•1h ago
I see what you’re getting at, but if you add a database call the I/O blocking time will completely eclipse CPU time. It would not be a useful comparison, similar to if you added a time.Sleep to each event handler.
hinkley•55m ago
The reviews by some other people here lead me to believe that it works fairly well both when there is something to process and when it's just chattiness.

If you mean Amdahl's Law (and maybe Little), messaging is generally considered part of the unavoidable. However TCP and this library both seem to be aware that while you cannot eliminate messaging overhead, you can amortize it over dozens and dozens of messages at a time and that reduces that bit of serialized cost by more than an order of magnitude.

scripturial•48m ago
How else do you compare “web frameworks” except foe comparing their overhead?

No everyone wants to write a database application. There are absolutely other types of applications in the world. Applications can be CPU and/or memory bound.