maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Competitors (https://talk.maemo.org/forumdisplay.php?f=4)
-   -   Meego vs Android apps (C or Java?) (https://talk.maemo.org/showthread.php?t=68730)

attila77 2011-02-07 23:31

Re: Meego vs Android apps (C or Java?)
 
Zimon, theory is one thing, reality is another (otherwise we'd be using lisp or prolog :) ). 5-10 years after the papers you mention and a few million (billion?) $ thrown at it by Sun and Google, it's still 'not there yet'. Android giving in to the pressure and being polluted by native code tells the story pretty well. And people wanting to earn their bread and/or geek creds writing code are doing it today - we're talking about *today's* technologies, not the hypothetical performance in some unclear point in the future.

PS. As for time critical - in mobile space 'slow' translates into 'power-hungry' (because it goes against race-to-idle, etc).

javispedro 2011-02-08 01:08

Re: Meego vs Android apps (C or Java?)
 
Quote:

Originally Posted by zimon (Post 938454)
When there is an application, which needs lots of "short" living dynamic memory, and needs to run relatively long time, for example www-browser with tab-support; JIT-interpreted code (Java) will be eventually faster than fully compiled code (C, C++).

Most of the already known running-time profiling+optimizing techniques are not yet implemented nor in use in VMs. Just think VM able to reorganize memory objects in heap memory so L2-cache usage is optimized. That trick cannot be made to fully compiled code, but can be made to bytecode based running programs.

What noone says is that there's an attached memory cost on this. Memory might be cheap on desktops (I'd disagree) but not yet on mobile... And, you know, if I were to waste more memory most algorithms have better ways to do it.

The other statement, that it can't be done to fully compiled code, is plain wrong. Previous week I was watching Intel-made slides about how there's various research teams trying to do exactly that (and some more optimizations that you can do when you start getting runtime information).

In fact, Transmeta used to do that (as attila already pointed out).

Capt'n Corrupt 2011-02-08 02:19

Re: Meego vs Android apps (C or Java?)
 
Quote:

Originally Posted by attila77 (Post 938512)
Zimon, theory is one thing, reality is another (otherwise we'd be using lisp or prolog :) ). 5-10 years after the papers you mention and a few million (billion?) $ thrown at it by Sun and Google, it's still 'not there yet'. Android giving in to the pressure and being polluted by native code tells the story pretty well. And people wanting to earn their bread and/or geek creds writing code are doing it today - we're talking about *today's* technologies, not the hypothetical performance in some unclear point in the future.

PS. As for time critical - in mobile space 'slow' translates into 'power-hungry' (because it goes against race-to-idle, etc).

Seriously?

Regardless of reality, that argument is invalidated by the most basic logic. Just because something has not been done, does not mean it cannot be done.

Radu 2011-02-08 09:43

Re: Meego vs Android apps (C or Java?)
 
Quote:

Originally Posted by Capt'n Corrupt (Post 938605)
Seriously?

Regardless of reality, that argument is invalidated by the most basic logic. Just because something has not been done, does not mean it cannot be done.

FFS... When you plan to buy a house, do you look at what is available on the market now, or do you look at futuristic designs that MIGHT come in 30 years?
When you buy a car, do you look at the cars there are now on the market, or the cars that will fly?

The Java/VM/JIT being faster than native code with the right tweaks is the biggest bunch of crap ever. How can someone sane believe that compiled code can't do the same stuff that VM/JIT code does? You never heard of stuff such as:
if(platform)do_platform_optimized_stuff();?
Or: If(have_sse)do_sse(); else do_non_sse();

There is NOTHING faster than native code (preferably well written ASM code). When you have the runtime code doing stupid stuff like garbage collection or enforcing array limits, there is a big speed penalty. Remember, the fastest code is the code that is not executed.
There is absolutely no reason for garbage collection, except to accommodate lazy/newbie programmers. Same with not using pointers because omfg, they are evil.

nicolai 2011-02-08 11:14

Re: Meego vs Android apps (C or Java?)
 
There is only one truth:
If you ask a developer, what is the best/perfect/fastes ...
programing language. And he/she answers language XY,
then he/she isn't a well experienced developer.

nicolai

attila77 2011-02-08 11:23

Re: Meego vs Android apps (C or Java?)
 
Quote:

Originally Posted by Capt'n Corrupt (Post 938605)
Seriously?

Regardless of reality, that argument is invalidated by the most basic logic. Just because something has not been done, does not mean it cannot be done.

Two (well, three) problems.

1. The predictions are based on how native compilers worked ten years ago and assume that they won't *qualitatively* be different in the future. From .NET and LLVM implementation we already know this is not true, so your baseline what you need to get better than IS moving upwards.

2. Occam's razor works against you. You know that the Java-ish VM approach has both advantages and disadvantages. There has been a tanker-loads of money sunk into optimizing it by Sun, IBM and Google. Where this turns into occam's razor is that 5-10 years later, it's still objectively slower, so either the perceived benefits are not as huge or as easily implementable as thought 10 years ago, or everybody at Sun/IBM/Google is an idiot. Your pick.

3. This 'compiler/VM/interpreter technology advances will make all current languages obsolete' is a repeating thing. I remember when lisp/prolog were the next big thing. Just imagine, you don't need to define procedures how tasks are done, so in theory a good interpreter can make a better native code path than a human programmer ever could ! The key here is - in theory. Academic papers will be happy to point out corner cases in which alternative approaches beat out the incumbent one, but we're not in the business of academic papers - software development is engineering, and engineers have the tools of today to build the applications of today.


Disclaimer (again): I was a Java guy, but nowadays I do C++ (w Qt) by day and Python by night.

zimon 2011-02-08 12:56

Re: Meego vs Android apps (C or Java?)
 
we, maemo5 and Meego are saved!
http://www.myriadgroup.com/Media-Cen...id-Phones.aspx

javispedro 2011-02-08 13:03

Re: Meego vs Android apps (C or Java?)
 
Quote:

Originally Posted by zimon (Post 938922)

Or they're doomed (that is something I kept on thinking since releasing preenv and watching how the thread developed).

On the other side, they require expresal approval and a few modifications* from the original app owners, so I believe this won't cause many "trouble".

* "Dalvik is not Android" I said, remember? ;)

v13 2011-02-08 13:22

Re: Meego vs Android apps (C or Java?)
 
Quote:

Originally Posted by Radu (Post 938765)
How can someone sane believe that compiled code can't do the same stuff that VM/JIT code does?

In theory you're right. In practice you're wrong.

What you say is true only under perfect conditions (like looking for a non-rating black hole). In practice much of a program's speed comes from the algorithms and code organization instead of small-things optimization. For example, in theory it would be faster if you used the assembly language but in practice this will result in slower code since you'll not implement common patterns as good as they are already implemented by any other language (or its libraries).

That's why it may be faster to write something in python using Qt bindings (or java) than write it in C++, since you'll take advantage of some very efficient data handling methods that you'll most probably won't implement yourself.

Of course there are many exception to the above (e.g. linux kernel), but when dealing with common program developers like ourselves, the above becomes mostly true.

However, there are other benefits in native code than the speed and that's where you should focus instead.

zimon 2011-02-08 15:08

Re: Meego vs Android apps (C or Java?)
 
Quote:

Originally Posted by javispedro (Post 938928)
Or they're doomed (that is something I kept on thinking since releasing preenv and watching how the thread developed).

On the other side, they require expresal approval and a few modifications* from the original app owners, so I believe this won't cause many "trouble".

* "Dalvik is not Android" I said, remember? ;)

But what this means, that when Nokia gets the first Meego phone out, it will then already have many applications available via Alien Dalvik. Someone who has had Android-phone, will more likely and willingly switch to Meego device now, because (s)he can get many (if not most) of the Android-apps with him.

There is always this unknown critical mass of applications so any platform can survive. Having ability to run Android apps in Meego helps to reach this critical mass sooner, or at once now.

It is interesting to see in the video, Adobe Photoshop Android application runs as fast in N900 under Alien Dalvik than in HTC (what model?) under real Dalvik.


All times are GMT. The time now is 08:23.

vBulletin® Version 3.8.8