JVM VS原生VS世界的性能

Lately I was trying to understand
how virtual memory works
and how JVM work and perform.
My intuition was ' if a JVM is written in C, it is probably less performant than C '
So after a lot of reading and investigations I found out that the story is much more complicated then I have initially thought.
JVM has many optimization which makes it very fast most of the time, it does has an overhead but the optimization in JIT make everything worth it.
basically the JVM will loaded into native virtual memory (and be shared with other processes when possible)
it will use sophisticated algorithms to allocate memory on the native heap to create managed heap.
it will JIT to perform well, will vectorise actions and what not to make the run time overhead worth it.
At that point I was thinking ' OK, so javascript is a VM, it should probably also perform well '
But benchmark tests online showed different things. I know javascript is single threaded but this tests take this into account (For example fork many process).
The V8 engine is highly optimized and make all kind of clever things to perform faster, for example making a behind the scene classes and types and caches to speed up the execution.
V8 is still young compared to C and Java so I am sure it will be even better. my impression is that optimizing a dynamic language such as javascript is harder than a language like java, but I might be wrong here.

Any way I thought that I have to make my own test to better understand the performance difference in various situations, so here it is, my results

  1. Java和节点在执行循环和在内存中时获胜c并从文件读取到磁盘的胜利开始Java在http服务器中获胜

希望您会发现此信息对您有帮助!

评论更受欢迎。

我也有一个博客,里面有其他有趣的东西:

Https://www.2bitornot2bit.com/blog

from: https://dev.to//benchuknii/performance-of-jvm-vs-native-vs-the-world-3mie

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值