Java or Python; Which should I recommend to others who are very sensitive to costs?

7 views
Skip to first unread message

Takashi Matsuo

unread,
Dec 15, 2009, 1:02:59 PM12/15/09
to google-a...@googlegroups.com
Hello,

Today I noticed that App Engine Java environment became much faster
then before. The spin up cost is about 700cpu_ms with the simplest
servlet. Additionally, when it comes to serving with a hot instance,
the cost reduces to 0-2cpu_ms, while python environment takes about
5-7cpu_ms even with the simplest handler.

To make it simple here, lets say Java takes 1cpu_ms while Python takes
6cpu_ms for serving very simple page.
How many requests can they serve with 1 cpu hour?

Java: 3600000 requests/1 cpu hour
Python: 600000 requests/1 cpu hour

This is a big deference; 6 times! If your app exceeds free quota, this
deference can impact total amount of costs significantly. I'm a big
Python fan and I have believed that appengine Python runtime is
superior to Java runtime, so I've been trying to persuade others to
use Python rather than Java for now.

Having said that, today it turns out for me that Java runtime is much
more cost effective than Python runtime in some cases, so should I
recommend others to use Apppengine Java if they are very sensitive to
cpu costs?

I'd appreciate if anyone could share one's thoughts/experiences on this.

TIA

--
Takashi Matsuo
Kay's daddy

trung

unread,
Dec 15, 2009, 1:16:38 PM12/15/09
to Google App Engine
How about jruby with rails? :)

Michael Langford

unread,
Dec 15, 2009, 1:34:31 PM12/15/09
to google-a...@googlegroups.com
>If your app exceeds free quota, this deference can impact total amount of costs significantly.

As can the difference in price/productivity between the two languages
as far as total cost of development goes.

The incremental costs on appengine between the two technologies are
dwarfed by the productivity differences between them for most
project's I'd imagine. I'd say if you're charging clients the same
amount to develop an app in Java as you are in Python, you're vastly
overcharging for the python or undercharging for the java (baring
language specific libraries available for one platform and not on the
other).

For a huge number of programs, the difference in development time
between a higher level language and a lower level language is never
recouped by increased runtime in the faster, lower level language.

For many apps, even java developers are faster writing python than
java (Although they all seem to go for Ruby instead).


--Michael
> --
>
> You received this message because you are subscribed to the Google Groups "Google App Engine" group.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
>
>
>



--
Michael Langford
Phone: 404-386-0495
Consulting: http://www.RowdyLabs.com

Jesaja Everling

unread,
Dec 15, 2009, 2:01:51 PM12/15/09
to google-a...@googlegroups.com
Maybe the people asking if it's possible to run Jython on App Engine
were on to something, after all! ;)
I also think choosing the toolkit that works best for the task at hand
is more important. Furthermore I'm confident the App Engine team will
speed up the Python runtime further; maybe that's part of what Unladen
Swallow is meant for.
A very interesting observation, though!

Best Regards,

Jesaja Everling

Michael Langford

unread,
Dec 15, 2009, 5:01:02 PM12/15/09
to google-a...@googlegroups.com
Jython works just fine on App Engine. There is even a list of popular
API's that do.

I don't know about speed differentials there.

http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine?pli=1

--Michael

Andy Freeman

unread,
Dec 15, 2009, 6:29:36 PM12/15/09
to Google App Engine
> Having said that, today it turns out for me that Java runtime is much
> more cost effective than Python runtime in some cases

The question is not whether the Java or Python runtime is more cost
effective in some cases, it's whether it which is more cost effective
in your cases.

Suppose that your application does one datastore operation for each
page and that datastore operation and other code takes the same amount
of time in both Python and Java. Datastore operations are so much
slower than startup that this alone would make the startup difference
almost unnoticeable.

And, as someone else pointed out, development time is a cost too.

On Dec 15, 10:02 am, Takashi Matsuo <matsuo.taka...@gmail.com> wrote:

Nash-t

unread,
Dec 16, 2009, 2:25:16 PM12/16/09
to Google App Engine
There was talk about running python and java in the same application
by using different version strings.

If you suspect one area of your application would run faster in java,
maybe you could code it up in java and push it to the same server as
your python application.

I don't know how they would communicate (via AJAX? memcache?) but I
think they would both use the same data store.

Ikai L (Google)

unread,
Dec 16, 2009, 2:53:57 PM12/16/09
to google-a...@googlegroups.com
It's technically possible. Both applications will use the same datastore, but doing things this way could lead to a maintainability nightmare.

--

You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.





--
Ikai Lan
Developer Programs Engineer, Google App Engine

Nash-t

unread,
Dec 16, 2009, 3:15:44 PM12/16/09
to Google App Engine
So far I have been able to reuse the same version string anyway,
handling versions before the push.
Maintainability nightmares are often opportunities. Could you give a
little more detail where you suspect problems would arise?
Also, would they share the same memcache? I assume they would.

Thanks,
Tim
> > google-appengi...@googlegroups.com<google-appengine%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages