3 ms·
> could have been done natively if it had to I don't think so. Do you mean by something like JNI? The use-cases of Unsafe that I see most often would not have
by chrisseaton 8y ago
> could have been done natively if it had to
I don't think so. Do you mean by something like JNI? The use-cases of Unsafe that I see most often would not have been tractable using JNI. They rely on intrinsification.
> it was just used to improve performance
But to the point where Java is not suitable at all without the performance, so it's not a nice-to-have for some people, it's essential.
- kodablah 8y agoThe use cases I saw were memory alloc, but I admit not being too familiar with its common uses. The other uses I saw were just for perf improvement over existing synchronization/reflection approaches. While I agree that performance is often essential, I don't think the gains from unsafe measurably affected the language's success. Even without, the performance was still a draw compared to many other high level options. If anything, I do think it kept a bunch of libs from dipping into JNI.