[OSM-talk] Java and JOSM
jwhelan0112 at gmail.com
Mon Apr 12 15:27:14 UTC 2021
I'm more than happy to back an Intel optimising compiler against JAVA at
I think we are getting into Computer Science debate areas here but given
the very large number of machines that run JOSM something that is
optimised for the X86 CPU instruction set would need fewer machine
cycles to run.
Yes I am sensitive to each CPU has it's own set of instruction timings
and has microcode. Years ago when I programmed in assembler I would from
time to time add up the instruction times for different methods of doing
the same calculation looking up the times for the processor I was targeting.
It doesn't matter if each machine runs the instruction once or not, if
50,000 machines run the same instruction then it is worth doing.
Translation faster performance on laptops.
Then we get into the realm of the Raspberry Pi. Yes you can run JOSM on
it but really it could do with a native editor and that I think would be
a game changer for editing for those who have lower income levels.
Hartmut Holzgraefe wrote on 4/12/2021 11:05 AM:
> On 12.04.21 16:22, Marc Gemis wrote:
>> Java is not a purely interpreted language, it uses a Just-in-time
>> compilation. 
> well, Java the language is actually compiled. It is just being compiled
> into a low level intermediate language, the JVM bytecodes.
> It is then up to the runtime engine whether it further converts the JVM
> bytecodes into actual machine code for the CPU it is running on, or
> processes the byte codes directly in a small interpreter runtime. JVMs
> usually do the former, while e.g. PHP did the later and has only recently
> started to change this with PHP 8.
> But even when converting JVM byte codes into native code, you have a
> tradeoff between compile time and run time. For code that's only going
> to be run once you may be better off just interpreting the byte codes
> directly, or compiling them into actual machine code at the lowest
> optimization level. For code that runs repeatedly, like the main event
> loop of a GUI app, on the other hand it makes sense to spend more time
> on optimization of the generated native machine code.
> And that's what JVMs usually do: gradually increase the optimization
> of machine code for parts of the code that are being run often, by
> re-compiling JVM byte code when execution statistics show that it seems
> to be worth the effort.
> PS: The good old interpreter vs. compiler distinction is a dead horse
> anyway. All but the most simple DSLs these days are either true
> compilers, or hybrids that lean more towards the compiler side of
> things. The last true interpreter that I remember using was PHP 3,
Sent from Postbox <https://www.postbox-inc.com>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the talk