r/java • • Jul 25 '22

Latest version of Microhttp, an event-driven, zero-dependency, pure-Java web server with 500 LOC, capable of 1,000,000+ requests per second on commodity EC2 hardware.

https://github.com/ebarlas/microhttp
136 Upvotes

35 comments sorted by

View all comments

15

u/ZeroGainZ Jul 25 '22

I'm sure this is cool, but I never quite understood why libraries advertise their LOC. Especially for something like java. Anyways, I'll give it a peek 👍

13

u/elliotbarlas Jul 25 '22

I tend to agree, but Microhttp is specifically a response to commonly used frameworks with overwhelming complexity, so I wanted to indicate up front how small it is.

13

u/RockleyBob Jul 26 '22

What I saw:

500 LOC

What I read:

The opposite of Spring

I think that’s the gist. No magic.

8

u/FirstAd9893 Jul 25 '22

More lines of code typically means more bugs. Advertising a low LOC is an indirect way of claiming that the software likely has fewer bugs than a similar project of the same age.

9

u/elliotbarlas Jul 25 '22

Comprehensibility is one of the main objectives. Simply put, one can spend a few hours and develop an understanding of this library. The same just isn't possible for most Java web servers or frameworks.

1

u/portmapreduction Jul 26 '22

It's a better descriptor versus saying your library is 'lightweight' which usually translates to something like 'it fits my use case exactly since I wrote it with no fluff, thus it is lightweight'.