Hacker News new | ask | show | jobs
by oscargrouch 3888 days ago
A java jitted VM built from scratch.. i wonder if we have a way to see how it performs, compared to other jits (specially the Android ART)?

By a very crude look at the source, looks very lightweight indeed

> Just-In-Time (JIT) compilation for fast method execution

> Generational, copying garbage collection ensures short pause times and good spatial locality

> Thread-local heaps provide O(1) memory allocation with no synchronization overhead

> Null pointer dereferences are handled via OS signals to avoid unecessary branches

2 comments

One of the core contributors here. I don't have any numbers, but I can reasonably guess it'll only beat the most naive JITs (i.e., JITs that only copy predefined templates that implement each instruction). Avian's JIT does no optimizations beyond a simple linear-time register allocator and a very basic instruction selector. Avian can run a simple Hello World somewhat faster than HotSpot, but that's about all. In any real-world scenarios, HotSpot and Dalvik/ART will kick the pants off it.

However, that's not what Avian is designed for. We (ReadyTalk) don't have the resources to compete in that sort of market, as fun as that might be. We designed Avian to run a relatively light-weight client application, so we can deploy the same code across all our platforms. We're not running a game or a server, so we don't care a lot frame rate or requests per second.

> However, that's not what Avian is designed for. We (ReadyTalk) don't have the resources to compete in that sort of market, as fun as that might be. We designed Avian to run a relatively light-weight client application, so we can deploy the same code across all our platforms. We're not running a game or a server, so we don't care a lot frame rate or requests per second.

I still don't see how it's better than Java in that scenario, which also runs on all platforms?

It really stems from the need to deliver commercial software to enterprise customers on a variety of platforms. At least some (if not many) enterprise customers don't want to roll out Java across all of their clients machines. Additionally, not all enterprise customers have the privileges required to install Java themselves. The bundling of the application into a single executable file is advantageous in this scenario.
Null pointer dereferences are handled via OS signals to avoid unecessary branches

Exceptions like page faults are very slow in modern CPUs in comparison to branches. Branch prediction works really well.