4 ms·
Doesn't look very fast on benchmarks: https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=plaintext https://www.techempower.com/benchmarks/#sect
by ddorian43 9y ago
Doesn't look very fast on benchmarks: https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=plaintext https://www.techempower.com/benchmarks/#section=data-r14&hw=... .
- jrs95 9y agoIt's rather bloated, and constantly throws exceptions for control flow. It can be convenient, but it's not really worth it in my opinion.
- ddorian43 9y agoWhich is in your opinion ?
- jrs95 9y agoI guess it's all my opinion, other than exceptions for control flow. Set your debugger to pause on all exceptions and then hit a hello world endpoint...it's terrifying.
- le-mark 9y agoI sometimes see people object to exception based control as you do here. I get it; it's essentially goto in diguise. But I've never read anyone discuss the pros and cons, or definitively call it out for what it is. Do you have any references on this topic?
- peoplewindow 9y agoExceptions for control flow are a performance problem in most environments. The JVM does a good job of optimising exceptions very aggressively but throwing one is a relatively expensive operation if the JIT compiler wasn't able to fuse the throw/catch together. It's a bit weird to use exceptions for control flow for this reason.
- jrs95 9y agoI don't, but the when exceptions become the norm it makes debugging much more difficult. I'm not an expert on the subject, but it seems to have a negative impact on performance as well. And in the case of a simple web app, it just shouldn't be necessary. Maybe it makes sense for Spring to do it, but that would indicate that it's more complex than it needs to be.
- alanfranzoni 9y agoI don't understand the benchmark completely (there seem to be some web server or "network programming framework" mingled with web frameworks? wut?), by the way I'm sure that pure speed is not Spring best virtue, and it's not Java's either, unless you take care at pre-warming the JIT and you've got enough RAM (and I suppose that, even then, Spring would be slower than other, 'shallower' frameworks). Spring makes it easy and fast to develop web applications, AND evolve them in time. A lot of things are ready out of the box, but you can easily customize many, many parts of your application when and if you actually need it, substituting what the framework would do for what YOU actually need. I haven't found anything like that, yet, in other web frameworks (admittedly: there's tons out there, so I probably tried 1% of them).
- kod 9y ago> I'm sure that pure speed is not Spring best virtue, and it's not Java's either Go look at those benchmarks again. Over half of the top 10 are JVM servers.
- alanfranzoni 9y agoYes... SERVERS... not frameworks. Usually Java-based frameworks are a bit more complex than Python/Ruby/Javascript based ones.
- kod 9y agoPlain old java servlets are the #1 result on the json benchmark, at over half a million requests per second. The implementation is less than 40 lines, most of which is imports / comments / curly braces. I have no idea what point you're trying to make with regards to complexity or some kind of server vs framework distinction.