2.1 Concern - Am I the only one?

andjarnic

Member
Joined
Nov 7, 2009
Messages
239
Reaction score
0
Location
Sacramento area, CA
I don't really agree with you Purgatory on your stance on Java. I will agree that it's slower than native in some areas, such as games and such.. but you can get around most of that with mixing java and C.. getting the benefits of Java for some things, while still using some C for specific reasons. That said, I've seen and been part of very large scale robust Swing desktop applications that are rock solid smooth on slower hardware. My point about you saying it's slow and it's not is that the mind set that most people have of it stems from over 10 years ago and for some reason most people can't seem to let that go. It really stems from the push for Java applets to be the next great web thing.. and how miserably they failed for a number of reasons, being slow was one of them. Funny thing is, you can embed applets now and they are pretty solid and very fast, as fast as Flash or anything else. Sun/Java community chose to put time into JavaFX instead however, because they knew that Java + applets had an imprinted bad taste on everyones brain, even people who had no idea what it really was.

Java was created to bridge the gap with cross platform development that was a major pain in the arse (and still is) and the various platforms, including at the time set top boxes. I still argue that if Java was really that slow, it would not be in so many devices. I think to be fair, Java was a bit easier to learn than C + various underlying processor architectures. If J2ME were done in C instead.. you'd have to figure out each phone architecture and learn the nuances of it to really utilize the various devices.

But, today, with JDK 1.6, the JIT is so effecient at turning bytecode into native code that many apps run faster because the JIT can actually monitor slower bytecode and speed it up better than a pure native compiler could primarily because it analyzes runtime performance bottlenecks. You could, no doubt, compile code, run it, watch slowness, and do that yourself in your code, keep recompiling it, etc. But in this case, java developers get the luxury of the java language and rich libraries and support, with the knowledge that the JIT will vastly increase the speed of slow segments of code. That could be a double edge sword.. some developers may rely on that and not care about the quality of their code. I personally have been an optimizing freak since my C days, always trying to wreak more speed while making my app smaller in size and less code.

Anywho, it's ok to agree to disagree. :D
 

Purgatory

Member
Joined
Jan 19, 2010
Messages
130
Reaction score
0
Anywho, it's ok to agree to disagree. :D

I completely agree with this.

However, i say it is in everything just because most of the hard work has been done for making it work in everything, as this is what it was made for.

I will agree, it is VERY fast compared to what it used to be, and is actually faster than the iphone in some respects, and not in others (ie. shut down time). I love the phone for its customization and how open it is, and can honestly say, that if I ever had a choice, I will always choose something that I can program for myself, instead of having to pay a hefty fee to make someone approve of the apps for me to use myself.
 

speed4tu

Member
Joined
Dec 7, 2009
Messages
59
Reaction score
0
Location
Eastern NC
Am I the only one who really don't care if 2.1 comes out today or anytime in the immediate future? It really doesn't do that much more than 2.0.1. I could care less about the animated wallpaper as I have never used stock wallpapers on anything.
 
OP
tha]-[acksaw

tha]-[acksaw

Member
Joined
Nov 30, 2009
Messages
79
Reaction score
0
Location
Bay Area, California
Don't worry man, some people can't handle the fact that others may be offering constructive criticism about their beloved phones. I agree completely that there isn't anything that could force me to go to an iPhone. But it does beg the question what causes this slight, and I repeat SLIGHT lag that many have noticed. It's not bad, just noticable. And asking whether or not it can be fixed and having concerns on whether or not it might get worse is understandable. Now, from what I've heard, 2.1 is supposed to be optimized for our phones when it comes out and supposedly even the unoptimized versions people have been running on their phones has felt more snappy than 2.0.1. So take that for what it's worth.

Thanks man! I seem to get lots of that on this forum. Even though I LOVE MY DROID! HAHA!

I appreciate the feedback!
 
OP
tha]-[acksaw

tha]-[acksaw

Member
Joined
Nov 30, 2009
Messages
79
Reaction score
0
Location
Bay Area, California
Hey all,

As a long time Java engineer and a developer for Android, let me set a few things straight on the lag issue.

First, Purgatory, you sadly fall into the camp of people who still believe Java is slow. It got a bad rap in the late 90s and it WAS slow back then. But in the early 2000's and especially now, it's gotten much faster. If you do some searching, you'll find plenty of cases, especially scientific equations and such where Java actually is faster than native code. As well, Java is by far the largest server side "performance" technology out there. If you've ever run any of the latest Java Swing apps using JDK 1.5 or better.. 1.6, you'll see that most things are very snappy and when you do see lag, it's for the same reason that Droid has lag. So let's be clear that java is NOT slow any longer. JDK 1.7 is going to increase that speed to almost no wait times on starting apps and a number of other goodies. To further argue that Java is not slow, I point to none other than Android powering the most advanced smart phones in the world. I know google is behind it and they are a large Java shop. But google could have done this years ago. I personally feel that they are using Java for a number of reasons, one of them being that it is plenty fast for a mobile device. If it was too slow, like back in the late 90s when the Java platform itself was undergoing significant changes, I doubt they would have gone forth with it. To me, it says something when one of the most successful and largest companies in the world place all their bets on Java on a mobile device.

Next, let's address the lag. There are two reasons any Android device is going to seem somewhat slower, and at times it seems just fine, but other times you'll see some lag. The first issue is with how Java generally is developed. Usually most developers avoid creating things until actually needed. Depending on how many "things" are needed, this can take a little bit of time.. and by little bit we're talking milliseconds.. but enough to notice it sometimes. This idea of waiting till absolutely needed to create things is probably magnified on a mobile device with limited resources. I personally have only seen the home screen lag sometimes, but most of the time it's fine. I have a couple of widgets on one home screen and it's possible those are loading when I've not used my phone for a while and been on that screen. This is the other point to this "lag". Java tries to recoup anything not being used for a while. There is more detail to this than needs to be explained, but generally, Android will "shut down" applications to make room for other running apps when there isn't enough resources. In my case, I may run 15 different apps over a period of time (not all at once), but at some point, the media player widget that is on a home screen that I am not using but it was loaded due to me going to that screen (so that it's ready to play music), may no longer be needed... so Android may determine that for one of my other apps to run, the media player needs to be killed (shut down) to recoup some memory for my new app to run. Now, next time I go to that home screen, it may take a few milliseconds for the media player widget to start up and be ready again. Hence the lag I may see.

The other reason, and this is a big one for us Java developers on android, is the lack of a JIT. For those that are not java programmers and don't know what a JIT is, JIT == just in time.. it basically is a runtime analysis native code compiler that desktop/server side Java has, and J2ME (older java mobile devices) have. For some reason, the Dalvik JVM that google provides for Android was released without a JIT. A JIT greatly increases the performance of most applications. To give you a rough idea of why it is so important, some developers have done comparisons of basic tests (loops that dont do much, etc) and older J2ME devices are 10 to 20x faster than Android on comparable hardware! So, seeing older much less evolved J2ME hardware run that much faster than Android is really upsetting for us developers. This may also contribute to some of the lag you are seeing. Now, to counter my comment to Purgatory about Java not being slow.. in this case.. on Android devices, he is right. It's quite slow comparatively speaking. BUT, it is VERY fast for a mobile device.

So all that explained (hopefully it wasn't too far out there for anyone that doesn't understand java/programming), we ALL have a few things to look forward to very soon. Right now there is indeed a JIT project in the works for Dalvik. When that is released, hopefully sometime this year, I would imagine with either a 2.5 or 3.0 platform release, we should see a very nice boost in application performance.

As well, there are some issues right now plaguing games and music apps development on Android that is hopefully sooner than later going to be updated to allow more iPhone like games/music apps being possible for Android. Right now, having done a lot of reading on game development on Android, there are a lot of hoops developers have to go thru to get a fairly decent frame rate going for games. So if/when these newer libraries are released.. I am hoping at the same time that a JIT is released, we should see a nice boost in capabilities for games and music apps, and as well all apps across the board should see a nice boost in performance.

Anywho, I wanted to try to clear that up from my developer perspective. There are no doubt other issues.. such as you may be running badly written applications that could be consuming lots of cpu time and slowing things down, have too many apps running and low on memory, etc. But the two points are the gist of why Android in particular might feel sluggish at times.

I can't thank you enough for posting up this information. Not all of us have a full understanding of the in's and out's of this kick ass phone. It's nice to get a little insight as to how and why things work the way they do.

This problem seems like a lot less of a problem now that I have a little understanding. Really man, THANK YOU !
 
OP
tha]-[acksaw

tha]-[acksaw

Member
Joined
Nov 30, 2009
Messages
79
Reaction score
0
Location
Bay Area, California
Am I the only one who really don't care if 2.1 comes out today or anytime in the immediate future? It really doesn't do that much more than 2.0.1. I could care less about the animated wallpaper as I have never used stock wallpapers on anything.

I'm kinda with you. But it seems like lots of people have hope for an ever quickening device due to optimized updates. I can do without the features, but if my phone is gonna keep getting snappier as time goes by, I'm all about the updates. Other then that I'm happy as a clam with the OS, the way it works and all the apps and such.

Great phone!
 
Top