Directions to iPhone, Windows & OS X

I was thinking about the Delphi Mobile Roadmap and got the idea of making some Highway signs to illustrate that theme. Mostly for fun.

Delphi XE4 - iPhone, Windows & Mac OS X

Feel free to share this image with others who may be looking for direction to reach iPhone, iPad, Windows and OS X from a single tool.


Why Some Mobile Apps are So Slow

If you haven’t read the lengthy article on Why Mobile Web Apps are So Slow I recommend you check it out. It appears well researched, citing lots of tests, sources, benchmarks and authorities. In summary JavaScript is garbage collected, and garbage collection introduces overhead making it up to 5x slower than native code. This isn’t such a big deal on x86 desktops, but with the slower architecture of ARM it is killing the performance of mobile apps.

Take a look at it, even if you just skim it you will no doubt learn something about this heated debate. Oh, and everywhere it talks about LLVM and ARC remember that is the same architecture that Delphi uses [PDF]  for iOS development (and Android soon too).

Also keep in mind that JavaScript isn’t the only garbage collected language on mobile devices. Languages that run on the Java Virtual Machine and .NET Framework are also garbage collected, as are most all scripting languages. This includes the Dalvik Virtual Machine that non-NDK Android apps run on. Granted Dalvik is optimized differently than that Java Virtual Machine, but it is still garbage collected, so it will still pause program execution at some point.

Quote from the article by Herb Sutter:

Managed languages made deliberate design tradeoffs to optimize for programmer productivity even when that was fundamentally in tension with, and at the expense of, performance efficiency

Which was endorsed by Miguel de Icaza of Mono & Xamarin:

This is a pretty accurate statement on the difference of the mainstream VMs for managed languages (.NET, Java and Javascript). Designers of managed languages have chosen the path of safety over performance for their designs.

Points to remember:

  • Garbage collection is up to 5x slower than native code
  • This is a much bigger deal on ARM architecture than x86
  • Automatic Reference Counting (ARC) is not Garbage collection
  • Delphi uses LLVM architecture and supports ARC like Objective-C

Clarification: A big part of the slowdown is that JavaScript is also a dynamic language, so all garbage collected languages are not 5x slower than native code. There are pros and cons to GC and ARC. There is a comment on the article that points out the 5x comparison was between GC and manual memory management, not ARC. There is overhead with ARC, but it doesn’t pause your apps execution.

Read the article and draw your own conclusions, but I’d love to hear what you think.

Audio podCast

Also on the Tablet Show

As an interesting turn of events I was interviewed on The Tablet Show a couple weeks ago. The Tablet Show is all about developing for tablet devices, and is by the same people who make .NET Rocks. The show is live today as episode 94. This show was recorded when I was still a Delphi MVP, before I was an Embarcadero Employee, but after I had accepted the position.

In this episode I am interviewed about Tablet Development Using Delphi and FireMonkey. It was a lot of fun and hopefully informative. Thanks to Carl and Richard for the interview.

Audio podCast

53 – Subject 33 & Android Game Development

Taking with Jason McMillen & Paul Nicholls of Pascal Game Development talking about Subject 33 and Android game development. Subject 33 is being developed with RemObjects Software’s Oxygene for Java and they are specifically targeting the new Ouya platform as well as Android in general.