Google app engine speed python vs java

1,540 views
Skip to first unread message

Olivier Austina

unread,
Jul 22, 2014, 4:34:53 PM7/22/14
to google-a...@googlegroups.com

Hi All,

I am interested in speed in developing application (mainly string manipulation) for app engine. Which language is speed java or python. In general what should I do to save more time. Any suggestion is welcome.

Regards
Olivier 

Peter

unread,
Jul 22, 2014, 11:29:49 PM7/22/14
to google-a...@googlegroups.com
If you prefer a complete development environment including IDE support => Java
If you need the most advanced features of App Engine => Python

Olivier Austina於 2014年7月23日星期三UTC+8上午4時34分53秒寫道:

Vinny P

unread,
Jul 23, 2014, 1:21:30 AM7/23/14
to google-a...@googlegroups.com
On Tue, Jul 22, 2014 at 3:34 PM, Olivier Austina <olivier...@gmail.com> wrote:
I am interested in speed in developing application (mainly string manipulation) for app engine. Which language is speed java or python. In general what should I do to save more time. Any suggestion is welcome.


To clarify: you're asking about speed in regards to development time, not app performance, correct? It varies depending on how comfortable you are with each language. If you're a beginner in both languages I would suggest starting out with Python: it's great with string manipulation and has a number of App Engine focused tutorials, such as https://developers.google.com/appengine/training/py101_1/ and https://www.udacity.com/course/cs253 .

Python is also a terrific starting language because the Python community tends to be pretty helpful and friendly, and the syntax is very readable.

  
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

Olivier Austina

unread,
Jul 23, 2014, 11:04:26 AM7/23/14
to google-a...@googlegroups.com
Thank you Vinny, I am about runtime speed. I have a code in C++ and I would like to run the program in App Engine. I am wondering which language is fast in app engine in terms of execution time.
Regards
Olivier

Luna Duclos

unread,
Jul 23, 2014, 5:00:38 PM7/23/14
to google-a...@googlegroups.com
Go is by far the fastest runtime for appengine currently, as it is (as far as I'm aware) the only compiled language currently in the mix.


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.

Vinny P

unread,
Jul 23, 2014, 5:18:32 PM7/23/14
to google-a...@googlegroups.com
On Wed, Jul 23, 2014 at 10:04 AM, Olivier Austina <olivier...@gmail.com> wrote:
I have a code in C++ and I would like to run the program in App Engine. I am wondering which language is fast in app engine in terms of execution time.
 
 
That gets a bit more difficult. I realize you specified that the app will be doing a lot of string manipulation, but depending on other application activities either language could win out. I'd recommend Python again though, purely since you talked about string manipulation,
 
Of course, the only way to really compare both languages would be to write both Java and Python apps (perhaps only implementing a subset of the full functionality) and compare them.

Adam Wildavsky

unread,
Aug 20, 2014, 12:13:36 PM8/20/14
to google-a...@googlegroups.com
Sorry to take so long to chime in! A couple things occurred to me that you might want to consider:

1. App Engine is addressed primarily towards building web sites and services, not heavy back end processing. That doesn't mean it can't be made to work, but you might want to consider building your site with App Engine and implementing the string processing portion as a service using Google Compute Engine or whatever platform seems best suited. One advantage is that you'd be able to keep your code in C++.

2. Have you measured the rate of your string processing and compared it to the overall response required by your application? In my experience a typical App Engine application's processing time is overwhelmed by network and datastore latency.

Jeff Schnitzer

unread,
Aug 22, 2014, 1:15:23 AM8/22/14
to Google App Engine
On Wed, Jul 23, 2014 at 1:59 PM, Luna Duclos <luna....@palmstonegames.com> wrote:
Go is by far the fastest runtime for appengine currently, as it is (as far as I'm aware) the only compiled language currently in the mix.

This is not true. Java is JIT-compiled.


TL;DR: Java and Go programs are about equal for pure computation, but if the garbage collector gets involved, Java is much faster.

Jeff

Jon Wayne Parrott

unread,
Aug 22, 2014, 3:19:43 PM8/22/14
to google-a...@googlegroups.com, je...@infohazard.org
Let's not forget how long the instance startup time is for Java applications vs Python and Go. Of course, once Java gets warmed up it's quick, but that loading request can be painful.

Though to be fair, it's much much better than it used to be.

Jeff Schnitzer

unread,
Aug 22, 2014, 3:27:34 PM8/22/14
to Jon Wayne Parrott, Google App Engine
Oh yes, definitely... which goes to show that there are usually many more important factors than than raw execution speed.

Although that said, if the app truly is compute-heavy, Python is almost certainly the wrong answer. For that matter, GAE is probably the wrong answer since instances are so underpowered. GCE is likely a much better answer... and there the OP can use his C++ code as-is.

Jeff

Kaan Soral

unread,
Aug 22, 2014, 4:11:50 PM8/22/14
to google-a...@googlegroups.com
S.O.-wise, from my experience, python community is pretty hostile, discarding questions as invalid and telling people the *right* way to do things instead of really answering the questions, 9 out of 10 times this was my experience

I would suggest python to Olivier

My Reasons
1) There are no common libraries for Go, however there are many common libraries/API's for python, if there isn't, it's pure joy to write ones yourself
2) People complain too much of Java/AppEngine (however I would consider the Java community more friendly, since the community itself is mostly beginners, they seem to approach others with empathy/sympathy)
3) Python is fun (consider PHP too if you are familiar to it, I was mainly using PHP, when there was no PHP on AppEngine, learned Python for AppEngine, but after experiencing Python, I would avoid PHP at all costs)

You didn't detail your exact use case as others mentioned, if you are just going to manipulate strings as background tasks, you would probably better of offloading computation to elsewhere

Cameron Blackwood

unread,
Aug 23, 2014, 2:32:27 AM8/23/14
to google-a...@googlegroups.com

You dont really give any indication of the project you need to be 'fast' so sorry if i under-estimate your skill, but just as a reminder to anyone starting out...

Unless your webapp (and it is a webapp, otherwise you would not pick appengine, right?) is **REALLY** heavy in need for CPU, programming language probably does not matter to the final speed.

Here is a link to some common computer operations: http://blog.codinghorror.com/the-infinite-space-between-words/

As you can see, any time you have to use the network or hit the disk then CPU is no longer your bottle neck. Check out the 'scaled to 1 CPU cycle == 1 second' times to get some appreciation of just how slow any external data access really is.

My suggestion is always program in the easiest language to code in to get your project working with the least possible bugs. Then test and revisit the code.

You can go back and optimise the speed *after* it works correctly.  For example, Id always pick python over c++ for any web project just because you can probably get the task done in 20 lines rather than 200 and in about 1/10th of the time in python. Ive seen too many starting programmers choose C++ because 'it is fast' when they just need to do simple operations that you could code n 10 lines in a scripting language.

Note this does not apply if you *REALLY* need the CPU, for example if you need to take some values in and generate 10000x10000 pixel Mandelbrot sets or something, but for 99.9% of webapps the programming language will make almost no difference to page compute speed.

IMHO, #include <disclaimer.h>, etc etc...

cam

Jeff Schnitzer

unread,
Aug 23, 2014, 4:55:14 AM8/23/14
to Jon Wayne Parrott, Google App Engine
I just noticed the OP's other question to this forum. Damn, I (we) got trolled.

Here is the correct answer to this question:


Jeff
Reply all
Reply to author
Forward
0 new messages