TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Continuous delivery makes JVM JIT an anti-pattern

32 pointsby foxgroverover 4 years ago

12 comments

winridover 4 years ago
Bad deployment system. You should do an A&#x2F;B deployment and warm up the services&#x2F;caches before the switch, so that the architecture handles the problem and not the programming language&#x2F;VM.<p>At FastComments we run our E2E tests on the new instance to JIT the app. Before the Jit API calls can take 100ms, and after 10-30ms. Still, that is fast enough that most people wouldn&#x27;t notice...<p>Also, the problem is not Java. Your application probably has way too many abstractions for a simple login page.
评论 #25995626 未加载
filereaperover 4 years ago
&gt;Molding a 25 year old runtime ecosystem to adapt to AOT compilation feels like putting lipstick on a pig.<p>Other JVMs like J9 have had AOT support for decades now, its not &quot;lipstick on a pig&quot;. There&#x27;s plenty of material from previous JVMLS meetups about AOT.
评论 #26124765 未加载
philipkglassover 4 years ago
The article&#x27;s &quot;container lifespan&quot; chart shows that 21% of containers live less than <i>10 seconds</i> and 54% live &lt;= 5 minutes. If the base data set has that many very-short-lived containers, it&#x27;s probably not representative of containerized persistent services. How many services get CD updates every 10 seconds?<p>Indeed, the original Sysdig report that the chart comes from makes this case:<p><a href="https:&#x2F;&#x2F;sysdig.com&#x2F;blog&#x2F;sysdig-2019-container-usage-report&#x2F;" rel="nofollow">https:&#x2F;&#x2F;sysdig.com&#x2F;blog&#x2F;sysdig-2019-container-usage-report&#x2F;</a><p>&quot;Many containers need to only live long enough to execute a function and then terminate when it’s complete. Seconds may seem short, but for some processes, it’s all that is required. We believe the increased use of Kubernetes Jobs that run finite tasks like batch jobs contributed to this growth. In fact, we expect short lifespans to increase, especially on serverless platforms that are well-suited to running short term tasks.&quot;
评论 #25996364 未加载
cromwellianover 4 years ago
Kotlin methods are final by default unless marked open, and thus nonpolymorphic dispatch unless through an interface.<p>It sounds to me like the problem isn’t the VM it’s the insane amount of framework code you have to be initialized. This can be optimized with Java via class data sharing and snapshotting but if your code is all written in Kotlin and you toss Spring into the trash can In favor of say, Dagger or hand crafted DI, most of your problems would go away.<p>Besides, Kotlin&#x2F;Native can compile and run without a VM.<p>See <a href="https:&#x2F;&#x2F;august.nagro.us&#x2F;jvm-startup.html" rel="nofollow">https:&#x2F;&#x2F;august.nagro.us&#x2F;jvm-startup.html</a> for examples of how to optimize startup without Prewarming JIT.
评论 #25997215 未加载
ncmncmover 4 years ago
This is about runtime binding vs static binding, not static objects or static members. There is still a &quot;this&quot;, but the code that will run is known up front -- &quot;ahead of time&quot;.<p>C++ went through this 25+ years ago: runtime binding, what in C++ is virtual functions, is a <i>niche technique</i>. Most C++ programs don&#x27;t use it at all, or use it in only one or two spots. When it is the right thing, it makes the work convenient, but it really is just a dance with function pointers. In C++, templates do the heavy lifting.<p>Java never offered any other support for organizing programs, so inheritance and virtual functions have been your go-to for everything, no matter how bad the fit. In a static call there is only one bit of code to run, and it never changes over the life of the program. Just like <i>almost everything</i>, really, except here your runtime knows up front.<p>It was always a dumb choice to make member functions default to virtual semantics, when they almost always don&#x27;t need it, and it just costs performance to no purpose. That is what comes out of treating language design as a marketing exercise: Java&#x27;s designers really (and openly) cared less than nothing about object-oriented programming. They thought people really ought to be coding Lisp. Forcing runtime binding was a way to sneak in something a little bit lispy, and maybe get people used to production code running no faster than Lisp.
评论 #25994728 未加载
评论 #25994225 未加载
olliejover 4 years ago
Others have raised good points, but seriously something is wrong if you’re pushing updates that require restarts every hour.<p>I get the idea of “continuous deployment”, but this is sounding like restart-per-commit. At that point I question how much qualification and validation is happening. No one say unit tests, they aren’t sufficient, and I’ve worked on multiple projects where the pre-commit test suite runs alone can take more than an hour. Even with those tests there are semi-regular breakages.
评论 #25996076 未加载
hctawover 4 years ago
&gt; 74% of containers have lifespans ≤ 1 hour<p>This sounds like a design flaw in the architecture. You don&#x27;t tear down a house to replace a lightbulb.
评论 #25993494 未加载
评论 #25996202 未加载
tom_melliorover 4 years ago
&gt; Production Java apps also typically run with APM tracing agents that rely on runtime bytecode instrumentation. [...] It is easier to start afresh with modern compiled languages like Go and Rust.<p>I wonder how they instrument their Go and Rust programs. If they decide not to, maybe it&#x27;s not that important for the Java version of the same code either.
评论 #25995656 未加载
lazideover 4 years ago
Every serious Java based Web App I&#x27;ve ever worked on had a prewarm step or continuous probing setup for exactly these issues. It isn&#x27;t unique to Java either - lots of languages have lazy library or dependency loading, or runtime caching of external files or the like that you want to do before you start serving requests.
评论 #25992970 未加载
commandlinefanover 4 years ago
&gt; Go and Rust encourage use of static method calls<p>Not having worked in Go or Rust but having done a lot of work in Java and C&#x2F;C++, I&#x27;m curious how this works out in practice. My experience with developers who default to static method calls rather than objects in Java or C++ is that they also default to static (and therefore global) data as well. Of course, you don&#x27;t have to do that: you can pass pre-transaction data structures to the static functions and let them operate on them, but that&#x27;s what object-oriented programming is for in the first place.
评论 #25992523 未加载
SureshGover 4 years ago
&gt;2 hours till the JVM C2 compiler is able to fully optimize<p>That&#x27;s really hard to believe claim with the request throughput you have.
pjmlpover 4 years ago
TL;DR; A company that sells Go consulting services bad mouths JVM JIT while completely ignoring JIT caches and AOT compilers that exist since around 2000.