harrycheung / Mobile-App-Performance

Source for this
https://medium.com/@harrycheung/cross-platform-mobile-performance-testing-d0454f5cd4e9
GNU General Public License v3.0
89 stars 26 forks source link

Add Appcelerator Titanium #1

Closed FokkeZB closed 9 years ago

FokkeZB commented 9 years ago

Can I help you to add Appcelerator Titanium?

harrycheung commented 9 years ago

Of course. I downloaded it today, and took a stab at it, and I'm already running into something. Would you mind taking a look? It's under the Titanium directory.

FokkeZB commented 9 years ago

I've done some fixes to make the app work, but I don't know how exactly your test itself is supposed to work. Please give it a try now and let me know if I can help.

harrycheung commented 9 years ago

Perfect. Thanks for the patch. I just needed to understand how code was imported. I'll finish the port and get the results up.

harrycheung commented 9 years ago

@FokkeZB I decided to structure my js a little differently, but I'm worried there's a performance impact. I ported my all of my logic to JS and set it up so I can run in a browser. As a result, I didn't use the CommonJS module structure. I then put the JS logic in the assets folder, and used Ti.include to bring it into the Titanium app. Is this ok or am I going to experience a performance impact vs using require?

harrycheung commented 9 years ago

Btw, it's checked in right now if you want to take a look.

FokkeZB commented 9 years ago

I've made all JS libs CommonJS compatible so they can be used in both the JS test and the Titanium test. I also took running the actual test and reading the multi data out of run.js so this file can be shared as well. See #3

harrycheung commented 9 years ago

Thanks for the patch. However, I'm still seeing the same performance as before. It's taking about 5.5 seconds to run the 1000 iteration loop (all the other apps do it at around 1 second). I'm seeing if there's an optimization flag I need to set in Titanium to speed things up, but I'm not being successful.

FokkeZB commented 9 years ago

What are you running it on? I get that 1s.

harrycheung commented 9 years ago

iPhone 6/8.1.2

On Fri, Feb 20, 2015 at 7:39 AM, Fokke Zandbergen notifications@github.com wrote:

What are you running it on? I get that 1s.

— Reply to this email directly or view it on GitHub https://github.com/harrycheung/Mobile-App-Performance/issues/1#issuecomment-75258134 .

FokkeZB commented 9 years ago

Mmm, wait... was running in iOS Simulator.

Getting 5.3s on an iPhone 6 as well.

But then, running the JS version on http://dev.fokkezb.nl/benchmark in Safari on the same phone also gets me no lower then 2.8s.

The difference between Titanium and the others are that Titanium runs the JS as is, while the other compile to the native language or even bytecode.

So I guess it's comparing apples and pears ;)

harrycheung commented 9 years ago

Yeah, the code isn't that complicated, and I verified it with unit tests in JavaScript/test.html. Btw, I get the same 3s in Safari.

On Fri, Feb 20, 2015 at 7:45 AM, Fokke Zandbergen notifications@github.com wrote:

Mmm, wait... was running in iOS Simulator.

Getting 5.3s on an iPhone 6 as well.

But then, running the JS version on http://dev.fokkezb.nl/benchmark in Safari on the same phone also gets me no lower then 3s.

Are you sure the tests on the others are identical?

— Reply to this email directly or view it on GitHub https://github.com/harrycheung/Mobile-App-Performance/issues/1#issuecomment-75259086 .

FokkeZB commented 9 years ago

So what your benchmarks really are comparing is the efficiency of different languages, including different bytecode compilations.

harrycheung commented 9 years ago

Yup. Out of curiosity, what did you think I was measuring? On Fri, Feb 20, 2015 at 1:30 PM Fokke Zandbergen notifications@github.com wrote:

So what your benchmarks really are comparing is the efficiency of different languages, including different bytecode compilations.

— Reply to this email directly or view it on GitHub https://github.com/harrycheung/Mobile-App-Performance/issues/1#issuecomment-75322594 .

FokkeZB commented 9 years ago

Good one.. I guess I was mislead by the "Mobile App Performance" title ;)

What would be more interesting then is to test Appcelerator's new Hyperloop Abstraction Layer. This new JS2Native compiler will replace the current interpreter.

Hyperloop is currently only available through the Windows Phone SDK developer preview: http://www.tidev.io/2015/01/12/how-to-try-the-titanium-windows-platform-preview-for-free/

I will try to port the test to it.

harrycheung commented 9 years ago

Ah, yeah. Sorry for the misunderstanding. It was a trade off of the short title vs writing a super long descriptive one. Have an idea when the JS2Native compiler will be available for iOS or Android? Hard for me to compare results otherwise.

On Sat, Feb 21, 2015 at 10:39 AM, Fokke Zandbergen <notifications@github.com

wrote:

Good one.. I guess I was mislead by the "Mobile App Performance" title ;)

What would be more interesting then is to test Appcelerator's new Hyperloop Abstraction Layer. This new JS2Native compiler will replace the current interpreter.

Hyperloop is currently only available through the Windows Phone SDK developer preview:

http://www.tidev.io/2015/01/12/how-to-try-the-titanium-windows-platform-preview-for-free/

I will try to port the test to it.

— Reply to this email directly or view it on GitHub https://github.com/harrycheung/Mobile-App-Performance/issues/1#issuecomment-75385608 .

FokkeZB commented 9 years ago

The Windows Phone SDK based on Hyperloop is not feature complete yet and the tests fail to work.

The iOS/Android version is only available in previous iteration of hyperloop:

We'll have to wait for Windows to be stable and/or iOS/Android to be finished later this year.