Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #30312

Re: Java 7 vs 8 speed issues on Win7?

From Jan Burse <janburse@fastmail.fm>
Newsgroups comp.lang.java.programmer
Subject Re: Java 7 vs 8 speed issues on Win7?
Date 2014-11-08 11:28 +0100
Organization albasani.net
Message-ID <m3kr8n$i9o$1@news.albasani.net> (permalink)
References (10 earlier) <m3gam2$dp7$1@news.albasani.net> <m3gr7o$h5o$1@news.albasani.net> <m3gs9q$6gr$1@dont-email.me> <m3guv8$oql$1@news.albasani.net> <m3i11c$jlt$1@speranza.aioe.org>

Show all headers | View raw


Bob(but not THAŢ Bob) schrieb:
> On Fri, 07 Nov 2014 00:07:26 +0100, Jan Burse wrote:
>
>> but for a better switch statement, a better compilation I wouldn't know
>> where to lookup this annotation. And even if the Hotspot JVM can do it,
>> probably my Dalvik JVM will not do it, to conserve battery life, it will
>> do no JITing at all.
>
> That's a false economy: whatever CPU cycle associated battery consumption
> is saved up front by not JITting, more is lost running interpreted
> instead of JITted code down the line in many instances.
>
> Anyway I heard that Dalvik is obsolete and being replaced by something
> called ART, which the source I read implied will be JITting.
>

According to this post Dalvik has JIT since 2.2, but
one has to explicitly enable it. Something along(*):

	dalvik.vm.heapsize=256M
	dalvik.vm.execution-mode=init:jit

I never tried it. But I guess one cannot do it on an
unrooted device, since it resides in build.prop(**).

On the other hand ART seems to have AOT and not JIT(***).
And the source says:

	"A technology preview of ART debuted as an
	alternative runtime environment in Android
	4.4 "KitKat". In the next major Android
	release, Android 5.0 "Lollipop", Dalvik was
	entirely replaced by ART.

But my point was an entirely different one. I only
wanted to give proof that nowadays there is not
"that particular" compiler optimization.

Even in the old days C compilers offered different
options -O<level>. Nowadays an application is typically
compiled to byte code and then further optimized on
the runtime platform (i.e. Java example).

So thats why its hard to talk for byte code based
languages about "that particular" semantic compiler
optimization change, since such changes typically can
depend on the runtime platform whether they are
available or not.

Unfortunately its also difficult to talk about
"that particular" substring(int,int) change in
general. Since the class String is part of the
Java runtime, and this runtime although it is
to a large part byte code, might also change from
platform to platform.

For example even if I compile my Android application
with JDK 8, this doesn't mean that the APK later
runs with the new semantic of substring(int,int).
Since the APK might run in an environment where
another String class implementation is used.

So I guess current developers, when they develop
for multiple platforms, face a new challenge.
They have to think in multiple semantics, and
choose designs that fit all, or give the best
compromise.

Bye

(*)
http://www.mobileread.com/forums/showthread.php?t=234339

(**)
http://www.droidwiki.de/Build.prop

(***)
http://en.wikipedia.org/wiki/Android_Runtime

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Java 7 vs 8 speed issues on Win7? Knute Johnson <eternal@knutejohnson.com> - 2014-10-22 10:18 -0700
  Re: Java 7 vs 8 speed issues on Win7? Silvio <silvio@internet.com> - 2014-10-24 11:10 +0200
  Re: Java 7 vs 8 speed issues on Win7? Roedy Green <see_website@mindprod.com.invalid> - 2014-11-05 04:36 -0800
    Re: Java 7 vs 8 speed issues on Win7? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2014-11-05 08:23 -0800
      Re: Java 7 vs 8 speed issues on Win7? Jan Burse <janburse@fastmail.fm> - 2014-11-05 20:47 +0100
        Re: Java 7 vs 8 speed issues on Win7? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2014-11-05 17:32 -0800
          Re: Java 7 vs 8 speed issues on Win7? Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-11-05 21:37 -0500
            Re: Java 7 vs 8 speed issues on Win7? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2014-11-05 20:00 -0800
              Re: Java 7 vs 8 speed issues on Win7? Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-11-05 23:32 -0500
                Re: Java 7 vs 8 speed issues on Win7? Robert Klemme <shortcutter@googlemail.com> - 2014-11-06 08:48 +0100
                Re: Java 7 vs 8 speed issues on Win7? Jan Burse <janburse@fastmail.fm> - 2014-11-06 15:09 +0100
                Re: Java 7 vs 8 speed issues on Win7? Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-11-06 09:50 -0500
                Re: Java 7 vs 8 speed issues on Win7? Jan Burse <janburse@fastmail.fm> - 2014-11-06 18:21 +0100
                Re: Java 7 vs 8 speed issues on Win7? Jan Burse <janburse@fastmail.fm> - 2014-11-06 18:34 +0100
                Re: Java 7 vs 8 speed issues on Win7? Jan Burse <janburse@fastmail.fm> - 2014-11-06 23:03 +0100
                Re: Java 7 vs 8 speed issues on Win7? Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-11-06 17:21 -0500
                Re: Java 7 vs 8 speed issues on Win7? Jan Burse <janburse@fastmail.fm> - 2014-11-07 00:07 +0100
                Re: Java 7 vs 8 speed issues on Win7? "Bob(but not" THAŢ "Bob)" <nobody@nowhere.net> - 2014-11-07 08:48 +0000
                Re: Java 7 vs 8 speed issues on Win7? Jan Burse <janburse@fastmail.fm> - 2014-11-08 11:28 +0100
        Re: Java 7 vs 8 speed issues on Win7? Roedy Green <see_website@mindprod.com.invalid> - 2014-11-20 03:12 -0800
          Re: Java 7 vs 8 speed issues on Win7? Silvio <silvio@internet.com> - 2014-11-20 13:24 +0100
            Re: Java 7 vs 8 speed issues on Win7? Robert Klemme <shortcutter@googlemail.com> - 2014-11-20 19:06 +0100
              Re: Java 7 vs 8 speed issues on Win7? Silvio <silvio@internet.com> - 2014-11-20 22:54 +0100
                Re: Java 7 vs 8 speed issues on Win7? Brixomatic <brixomatic@yahoo.com> - 2014-11-22 08:54 +0100
                Re: Java 7 vs 8 speed issues on Win7? Brixomatic <brixomatic@yahoo.com> - 2014-11-22 09:19 +0100
    Re: Java 7 vs 8 speed issues on Win7? Fredrik Jonson <fredrik@jonson.org> - 2014-11-29 07:44 +0000

csiph-web