The best Hacker News stories from Show from the past day

Go back

Latest posts:

Show HN: Faster FastAPI with simdjson and io_uring on Linux 5.19

A few months ago, I benchmarked FastAPI on an i9 MacBook Pro. I couldn't believe my eyes. A primary REST endpoint to `sum` two integers took 6 milliseconds to evaluate. It is okay if you are targeting a server in another city, but it should be less when your client and server apps are running on the same machine.<p>FastAPI would have bottleneck-ed the inference of our lightweight UForm neural networks recently trending on HN under the title "Beating OpenAI CLIP with 100x less data and compute". (Thank you all for the kind words!) So I wrote another library.<p>It has been a while since I have written networking libraries, so I was eager to try the newer io_uring networking functionality added by Jens Axboe in kernel 5.19. TLDR: It's excellent! We used pre-registered buffers and re-allocated file descriptors from a managed pool. Some other parts, like multi-shot requests, also look intriguing, but we couldn't see a flawless way to integrate them into UJRPC. Maybe next time.<p>Like a parent with two kids, we tell everyone we love Kernel Bypass and SIMD equally. So I decided to combine the two, potentially implementing one of the fastest implementations of the most straightforward RPC protocol - JSON-RPC. ~~Healthy and Fun~~ Efficient and Simple, what can be better?<p>By now, you may already guess at least one of the dependencies - `simdjson` by Daniel Lemiere, that has become the industry standard. io_uring is generally very fast, even with a single core. Adding more polling threads may only increase congestion. We needed to continue using no more than one thread, but parsing messages may involve more work than just invoking a JSON parser.<p>JSON-RPC is transport agnostic. The incoming requests can be sent over HTTP, pre-pended by rows of headers. Those would have to be POSTs and generally contain Content-Length and Content-Type. There is a SIMD-accelerated library for that as well. It is called `picohttpparser`, uses SSE, and is maintained by H2O.<p>The story doesn't end there. JSON is limited. Passing binary strings is a nightmare. The most common approach is to encode them with base-64. So we took the Turbo-Base64 from the PowTurbo project to decode those binary strings.<p>The core implementation of UJRPC is under 2000 lines of C++. Knowing that those lines connect 3 great libraries with the newest and coolest parts of Linux is enough to put a smile on my face. Most people are more rational, so here is another reason to be cheerful.<p>- FastAPI throughput: 3'184 rps. - Python gRPC throughput: 9'849 rps. - UJRPC throughput: -- Python server with io_uring: 43'000 rps. -- C server with POSIX: 79'000 rps. -- C server with io_uring: 231'000 rps.<p>Granted, this is yet to be your batteries-included server. It can't balance the load, manage threads, spell S in HTTPS, or call parents when you misbehave in school. But at least part of it you shouldn't expect from a web server.<p>After following the standardization process of executors in C++ for the last N+1 years, we adapted the "bring your runtime" and "bring your thread-pool" policies. HTTPS support, however, is our next primary objective.<p>---<p>Of course, it is a pre-production project and must have a lot of bugs. Don't hesitate to report them. We have huge plans for this tiny package and will potentially make it the default transport of UKV: <a href="https://github.com/unum-cloud/ukv">https://github.com/unum-cloud/ukv</a>

Show HN: TuringJest – Pretend to be an AI and spot the real one

Hi HN,<p>I have been working on this website for a few weeks with some buddies of mine and would love if you checked it out. TuringJest provides a jackbox-esque experience with its two game modes.<p>*One Shot Prompt* - Submit a prompt for all players (including the AI) to answer. - Answer your prompts in the way that you think ChatGPT would answer them. - Vote for who you think the real AI is.<p>*Talk It Out* - Plan an event in a group chat with your friends. - Trick everyone into thinking you are the AI while voting for the real AI.<p>Let me know what you think!

Show HN: Tiny Metasearch Engine to Find Software Developers

Show HN: A HN clone writen in Go

I've been trying to write my "go on rails" framework for years. I never quite got it like I wanted. There is gin and echo and all sorts of other frameworks and patterns but I finally found something I really like:<p>/foo/<p>/foo/bar/<p>/foo/bar/more/<p>That's it. Just three levels and all my controllers get passed in what's between the / with var names first, second, third.<p>In order to really make sure this framework could build something real I made a Hacker News clone. RemoteRenters.com is a HN just for articles about the remote work revolution since covid. Feel free to vote or submit to see how it all works!<p>Code is open source at: <a href="https://github.com/andrewarrow/feedback">https://github.com/andrewarrow/feedback</a>

Show HN: A HN clone writen in Go

I've been trying to write my "go on rails" framework for years. I never quite got it like I wanted. There is gin and echo and all sorts of other frameworks and patterns but I finally found something I really like:<p>/foo/<p>/foo/bar/<p>/foo/bar/more/<p>That's it. Just three levels and all my controllers get passed in what's between the / with var names first, second, third.<p>In order to really make sure this framework could build something real I made a Hacker News clone. RemoteRenters.com is a HN just for articles about the remote work revolution since covid. Feel free to vote or submit to see how it all works!<p>Code is open source at: <a href="https://github.com/andrewarrow/feedback">https://github.com/andrewarrow/feedback</a>

Show HN: OpenBB Terminal – Investment research for everyone

Show HN: OpenBB Terminal – Investment research for everyone

Show HN: Llama-dl – high-speed download of LLaMA, Facebook's 65B GPT model

Show HN: Llama-dl – high-speed download of LLaMA, Facebook's 65B GPT model

Show HN: Llama-dl – high-speed download of LLaMA, Facebook's 65B GPT model

Show HN: Lander, a lunar lander style web game

I’ve been working on this game for the past few weeks. It’s written in plain JavaScript, mostly with canvas, with no dependencies.<p>The code is here: <a href="https://github.com/ehmorris/lunar-lander">https://github.com/ehmorris/lunar-lander</a>

Show HN: Lander, a lunar lander style web game

I’ve been working on this game for the past few weeks. It’s written in plain JavaScript, mostly with canvas, with no dependencies.<p>The code is here: <a href="https://github.com/ehmorris/lunar-lander">https://github.com/ehmorris/lunar-lander</a>

Show HN: Lander, a lunar lander style web game

I’ve been working on this game for the past few weeks. It’s written in plain JavaScript, mostly with canvas, with no dependencies.<p>The code is here: <a href="https://github.com/ehmorris/lunar-lander">https://github.com/ehmorris/lunar-lander</a>

Show HN: Lander, a lunar lander style web game

I’ve been working on this game for the past few weeks. It’s written in plain JavaScript, mostly with canvas, with no dependencies.<p>The code is here: <a href="https://github.com/ehmorris/lunar-lander">https://github.com/ehmorris/lunar-lander</a>

Show HN: Hire from Communities (Fromcommunity.com)

Get your best resources from well-known communities within the industry, such as forums, online groups, or active community channels, where they have built a reputation for their skills and contributions.<p>We are happy to get feedback and join forces :)

Show HN: A Unix timestamp converter that includes the micro and nanoseconds

I find myself having to convert a lot of unix timestamps to a human readable format, but most of the online calculators I found don't include the micro or nanoseconds in the human readable output. It's a small detail, but I find myself having to manually space out the timestamp frequently. I'm learning frontend development, so I made this converter to hopefully make it easier to convert timestamps. Welcome to any feedback :)

Show HN: Watch ChatGPT debate itself on a given topic

Show HN: Watch ChatGPT debate itself on a given topic

Show HN: Watch ChatGPT debate itself on a given topic

Show HN: Procal: A simple Qt-based programming calculator

< 1 2 3 ... 445 446 447 448 449 ... 852 853 854 >