frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: PrinceJS – 19,200 req/s Bun framework in 2.8 kB (built by a 13yo)

https://princejs.vercel.app
100•lilprince1218•3h ago
Hey HN,

I'm 13, from Nigeria, and I just released PrinceJS — the fastest web framework for Bun right now.

• 19,200 req/s (beats Hono/Elysia/Express) • 2.8 kB gzipped • Tree-shakable (cache, AI, email, cron, SSE, queue, test, static...) • Zero deps. Zero config.

Built in < 1 week. No team. Just me and Bun.

Try it: `bun add princejs` GitHub: https://github.com/MatthewTheCoder1218/princejs Docs: https://princejs.vercel.app

Brutal feedback welcome. What's missing?

– @Lil_Prince_1218

Comments

waschl•2h ago
Mighty impressive
yahoozoo•2h ago
Any real world app is going to be waiting on, primarily, IO. These benchmarks that just hit an endpoint that returns a simple object are useless.
tayo42•2h ago
You would be otherwise just benchmarking the slow service if you benchmarked it any other way
koakuma-chan•1h ago
What is being benchmarked there anyway? Receiving a request from the underlying HTTP library, calling the user's handler function, and passing the response back to the HTTP library? Hono, Elysia, PrinceJS... all these "frameworks" really are just routers, and Bun comes with its own router.
ricardobeat•34m ago
No, you would be benchmarking the overhead of juggling several requests in flight, I/O and memory usage, which is what really distinguishes servers in terms of performance.
dlisboa•2h ago
I know it's intentional but very amusing name considering the country of origin.
alexfoo•29m ago
It’s almost certainly not because of the advance fee scam.

You don’t have to meet many Nigerians before you find one that claims to be some kind of a Prince back home.

Nigeria used to be hundreds/thousands of separate kingdoms and many people have a claim to be chiefs/kings of those historic kingdoms. Male descendants of such leaders will claim the unofficial title of Prince. They may not have any real national standing but such leaders will be respected by their local communities.

It may look like one big country but there’s no official single royal family (unsurprising since it is a Republic). To give an idea of the diversity of Nigeria consider the fact that the country has over 500 native languages that are actively spoken.

swiftcoder•2h ago
Congrats! That's a sleek framework.

Would love to see the benchmarks checked into source control somewhere so folks can reproduce them.

Can't say I'm the biggest fan of the way the sample code types itself out character-by-character. Took a while for the longer samples to finish typing themselves out.

jryan49•2h ago
Agree get rid of the character-by-character animation. It's very annoying.
Uptrenda•2h ago
Damn smart kid. You're going to have a bright future. Stay away from bad influences and you'll be a star.
fwip•2h ago
The github page claims "PrinceJS fits in a tweet," but also that it's 2.8kB after gzip compression.

Are tweets 2800 characters now? (Genuine question, I haven't used the place in years.

chuckadams•1h ago
People with blue-check accounts get a 25000-char limit. Everyone else is at 280. Have had twitter/x aliased to localhost for a while now myself.
moralestapia•2h ago
An actual nigerian prince that's not a scam. LOL.

Congrats on this, keep building more stuff!

jryan49•2h ago
Considering this is barely any code at all I imagine it doesn't provide anywhere near the feature set other web frameworks do. Also there are no tests. How do you know it even works properly? Why would I trust that it works properly?
jryan49•2h ago
I do want to applaud your efforts, especially at your age. Add some tests, and keep making things :)
gwd•2h ago
I thought it was going to have something to do with this:

https://princejs.com/

lxe•2h ago
Object.defineProperty on every request to set params / query / body is probably slower than regular property assignment.

Also parsing the body on every request without the ability to change it could hurt performance (if you're going for performance that is as a primary factor).

I wonder if the trie-based routing is actually faster than Elysia in precompile mode set to enabled?

Overall, this is a nice wrapper on top of bun.serve, structured really well. Code is easy to read and understand. All the necessary little things taken care of.

The dev experience of maintaining this is probably a better selling point than performance.

jasonjmcghee•1h ago
Nice job building a thing and putting it out there. It's a great accomplishment.
super256•1h ago
At that age I couldn't even code. Keep it up, young man :)
a-dub•1h ago
this is pretty fun, slick to think you can do things like this now and it will be performant: https://github.com/MatthewTheCoder1218/princejs/blob/main/sr...

interesting to dig deep into the bun runtime (it's in zig) to see how this remains efficient. it's a heap: https://github.com/oven-sh/bun/blob/509a97a43516fe4f6d4ff400...

of these: https://github.com/oven-sh/bun/blob/509a97a43516fe4f6d4ff400...

pretty cool clean and simple code for the framework (and bun).

lioeters•1h ago
Great job with building and releasing a project. The API looks intuitive, almost the same as Express. Documentation site is good! The animated code blocks is nice on front page but too distracting in the docs itself, I think.

A potential user would want to know: why is it faster? What's the compromise, if any. What specific quantifiable technical points make it faster than other libraries. Benchmarks and tests.

Overall the library feels like a polished open-source project, good attention to design and detail. Definitely valuable as part of a portfolio/resume. Keep going!

ramon156•1h ago
Impressive stuff! I see you have contributions startins 2023, does that mean you started programming at 11?
leeoniya•1h ago
i was initially confused how 19.2K rps is notable when Express typically benchmarks around 15K rps [1].

however, the author is benchmarking a route with an id param here, not a static route.

[1] https://github.com/uNetworking/uWebSockets/discussions/1415

bitwize•1h ago
Is from Nigeria

Has "Prince" in his HN nick and framework name

I smell either a rat, or an incredibly meme-savvy kid who leaned into the joke.

Anyways, congrats and keep on hacking!

stevepotter•1h ago
I got emotional thinking about a 13 year old releasing this. No brutal feedback, just proud of you buddy. Keep it going!
silvestreh•1h ago
This is really interesting, but I'd absolutely love if you could add a light theme to your website. I really can't read on a dark background, it kinda hurts my eyes and when I take my eyes off the screen I see a bunch of horizontal lines for a minute or so.
ricardobeat•59m ago
Nice work! Some notes:

1. File size is a commonly highlighted metric for JS frameworks because of network transfer cost on the client side. For node/bun/deno frameworks, it isn't very relevant, especially the gzipped size.

2. In the benchmark, the number for all frameworks is quite low - I get closer to 80-100k req/s with Bun on my 3-year old machine. Might be worth using a standard VM size in a cloud provider to make it more meaningful.

3. "Cron" scheduling doesn't seem to belong in the library. This won't be very useful for real-world use cases, as soon as you have >1 node running a server you'll need some form of coordination. More size reduction :)

ricardobeat•41m ago
some more after reading the source:

- JWT needs to be validated, as it is, your implementation[1] happily accepts anything, you can impersonate anyone you want. I'd argue that it's a bad default choice too [2]

- baking-in resend.com as email provider is unlikely to be useful for most people

- x-forwarded-for [3] is only added by proxy servers, and will often not be present. This means you'll be applying a shared rate limit to most of your users

- the 'ai' helper is missing from the code. If this is vibe-coded, having tests for the examples will help keep it cohesive

Sorry if this is a lot, I hope it can help.

[1] https://github.com/MatthewTheCoder1218/princejs/blob/main/sr...

[2] https://paragonie.com/blog/2017/03/jwt-json-web-tokens-is-ba...

[3] https://github.com/MatthewTheCoder1218/princejs/blob/main/sr...

Alex_L_Wood•57m ago
This is pretty impressive, wow! I always wanted to build a toy HTTP requests framework just to better understand the tools I’m working with, and here you are building the full thing.
altmind•26m ago
Will you bench against techempower benchmarks?
mikeday•22m ago
Ohhh Nigerian Prince, I thought it was a wrapper for our Prince HTML to PDF formatter, but there is also a JavaScript implementation of Prince of Persia lol.
mpeg•18m ago
This is cool, and it's a really impressive feat especially for someone with relatively little experience due to your age.

A few notes:

- it's easy to be faster than other routers when you're doing less, for example it seems wildcards are not supported yet, and there's no tests but I suspect there would be a lot of bugs in the way routes are handled. I wouldn't focus that much on speed

- your code organisation is ok for a personal project, but it could use a bit of structure. things are all over the place, I would try to separate pieces of functionality that can be developed (and, importantly, tested) in isolation. For example, your router could be its own module, that way it would also be easier to get started in writing unit tests. (once you've got some example code you can just offload a lot of the test writing to an LLM, then clean them up manually as it will do stupid things)

- your benchmarks are quite low in general, I don't know how good the node.js tool you're using for it is but I would give them a go with something like oha. also, it's very odd that hono beats elysia in your tests, in my own testing elysia is much faster than hono, but it suffers from the same tradeoffs as any trie based router (more set up time)

- instead of zod, you should use the @standard-schema/spec package, so that it can work with any validation library (including zod) – they have some nice type utilities too that simplify inferring types from schemas

londons_explore•17m ago
Rather than requests per second, I prefer 'clock cycles per request'.

As well as being slightly more hardware independent, it also helps highlight exactly how efficient/inefficient the code must be.

This code is ~100k clock cycles per request.

stevage•14m ago
How do you measure it?

Compiling Ruby to Machine Language

https://patshaughnessy.net/2025/11/17/compiling-ruby-to-machine-language
114•todsacerdoti•2h ago•5 comments

Show HN: I built a synth for my daughter

https://bitsnpieces.dev/posts/a-synth-for-my-daughter/
845•random_moonwalk•5d ago•160 comments

"One Student One Chip" Course Homepage

https://ysyx.oscc.cc/docs/en/
76•camel-cdr•5d ago•16 comments

Azure hit by 15 Tbps DDoS attack using 500k IP addresses

https://www.bleepingcomputer.com/news/microsoft/microsoft-aisuru-botnet-used-500-000-ips-in-15-tb...
115•speckx•5h ago•113 comments

Show HN: PrinceJS – 19,200 req/s Bun framework in 2.8 kB (built by a 13yo)

https://princejs.vercel.app
100•lilprince1218•3h ago•34 comments

Show HN: ESPectre – Motion detection based on Wi-Fi spectre analysis

https://github.com/francescopace/espectre
87•francescopace•8h ago•15 comments

Project Gemini

https://geminiprotocol.net/
178•andsoitis•6h ago•106 comments

FreeMDU: Open-source Miele appliance diagnostic tools

https://github.com/medusalix/FreeMDU
215•Medusalix•9h ago•55 comments

WeatherNext 2: Our most advanced weather forecasting model

https://blog.google/technology/google-deepmind/weathernext-2/
168•meetpateltech•7h ago•66 comments

Show HN: Continuous Claude – run Claude Code in a loop

https://github.com/AnandChowdhary/continuous-claude
58•anandchowdhary•2d ago•29 comments

My stages of learning to be a socially normal person

https://sashachapin.substack.com/p/my-six-stages-of-learning-to-be-a
220•eatitraw•2d ago•118 comments

An official atlas of North Korea

https://www.cartographerstale.com/p/an-official-atlas-of-north-korea
146•speckx•4h ago•78 comments

Aldous Huxley predicts Adderall and champions alternative therapies

https://angadh.com/inkhaven-7
44•surprisetalk•7h ago•19 comments

Astrophotographer snaps skydiver falling in front of the sun

https://www.iflscience.com/the-fall-of-icarus-you-have-never-seen-an-astrophotography-picture-lik...
160•doener•1d ago•38 comments

Insects on the Space Menu

https://www.esa.int/Science_Exploration/Human_and_Robotic_Exploration/Insects_on_the_space_menu
15•ohjeez•5d ago•2 comments

How to escape the Linux networking stack

https://blog.cloudflare.com/so-long-and-thanks-for-all-the-fish-how-to-escape-the-linux-networkin...
75•meysamazad•6h ago•9 comments

Our dogs' diversity can be traced back to the Stone Age

https://www.bbc.com/news/articles/ce9d7j89ykro
32•1659447091•3d ago•11 comments

Giving C a superpower: custom header file (safe_c.h)

https://hwisnu.bearblog.dev/giving-c-a-superpower-custom-header-file-safe_ch/
226•mithcs•12h ago•189 comments

My Kind of REPL

https://ianthehenry.com/posts/my-kind-of-repl/
11•ingve•6d ago•2 comments

Grok 4.1

https://x.ai/news/grok-4-1
64•simianwords•2h ago•35 comments

How when AWS was down, we were not

https://authress.io/knowledge-base/articles/2025/11/01/how-we-prevent-aws-downtime-impacts
70•mooreds•5h ago•38 comments

Ion: Modern System Shell in Rust

https://github.com/redox-os/ion
3•nateb2022•50m ago•0 comments

The time has finally come for geothermal energy

https://www.newyorker.com/magazine/2025/11/24/why-the-time-has-finally-come-for-geothermal-energy
83•riordan•8h ago•132 comments

Run ancient Unix on modern hardware

https://github.com/felipenlunkes/run-ancient-unix
4•doener•1h ago•0 comments

A graph explorer of the Epstein emails

https://epstein-doc-explorer-1.onrender.com/
176•cratermoon•2d ago•39 comments

Where do the children play?

https://unpublishablepapers.substack.com/p/where-do-the-children-play
283•casca•1d ago•221 comments

Are you stuck in movie logic?

https://usefulfictions.substack.com/p/are-you-stuck-in-movie-logic
155•eatitraw•10h ago•129 comments

Show HN: Kalendis – Scheduling API (keep your UI, we handle timezones/DST)

https://kalendis.dev
5•dcabal25mh•4h ago•0 comments

DESI's Dizzying Results

https://www.universetoday.com/articles/desis-dizzying-results
19•belter•5h ago•4 comments

People are using iPad OS features on their iPhones

https://idevicecentral.com/ios-customization/how-to-enable-ipad-features-like-multitasking-stage-...
120•K0IN•20h ago•117 comments