GAE 的 java 与 python
从这些链接中:-
http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=python3&lang2=java
http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=python3&lang2=java
http://shootout.alioth.debian.org/u64/benchmark.php?test=all&lang=python3&lang2=java
http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=python3&lang2=java
如果我们正在寻找可扩展的功能,那么它们显然表明 GAE 的最佳选择是 java。
我的问题是,如果我们使用其中一种框架,会对性能产生哪些影响?
例如
django --> python
spring MVC --> java
slim3 --> java
... etc
from these links:-
http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=python3&lang2=java
http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=python3&lang2=java
http://shootout.alioth.debian.org/u64/benchmark.php?test=all&lang=python3&lang2=java
http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=python3&lang2=java
they appear clearly that the best choice for GAE is java, if scalable feature is what we are looking for.
my question is, What are the implications that will affect on performance if we use one of frameworks?
e.g.
django --> python
spring MVC --> java
slim3 --> java
... etc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只是简单说明 - 不要将此视为明确/全面的比较:
Django 和 Spring 都有很长的启动时间,这可能会导致请求被丢弃。我会选择专门为 GAE 制作的框架:tipify、slim3 等。
Just a quick note - don't take this as a definitive/comprehensive comparison:
Both Django and Spring have a long startup time, which can lead to requests being dropped. I'd go with a framework that was speciffically made for GAE: tipify, slim3, etc..
我在 GAE 上同时使用了 Python 和 Java,其中一个项目使用 Python+Django 完成,另一个项目使用 Java/Groovy+Spring 完成。
Python+Django 最初开发起来很容易,但维护起来就不那么容易了。它有足够快的启动时间、良好的文档、atc。
Java+Spring 需要更多的开发(某些部分比使用 django 做同样的事情需要多 2-3 倍),启动时间有问题(即使您使用
warmup
请求)。但它稳定得多。Python 项目有太多错误,大多没有任何可见的(对你来说)原因:(并且由于 lang 的动态特性,很难找到此错误的原因。而且,准备好手动修补你正在使用的一些库不要误会我的意思,我有多年的Python经验,但是在像GAE这样的分布式系统上维护它真的很困难,而且它确实存在代码质量问题:(
另一方面,Java运行得很好。如果您的代码出现问题,您将看到修复此问题所需的所有信息,并且经过几次迭代后,您将修复几乎所有错误,除了一个:有时您会看到启动错误:( 不是太频繁,顺便说一句。
PS 顺便说一句,为 GAE 选择正确的语言取决于您更了解哪种语言:) 如果您还不了解 Java - 不要从它开始,它至少需要 1-2 年才能理解语言。
I'm used both Python and Java on GAE, one project done using Python+Django, and one using Java/Groovy+Spring.
Python+Django is very easy to develop, initially, but not so easy to maintain. It have enough fast startup time, good documentation, atc.
Java+Spring requires more development (some parts takes 2-3 times more than doing same using django), have problems with startup time (even if you are using
warmup
requests). But it much more stable.Python project have too much errors, mostly without any visible (to you) reason :( And it's very hard to find cause of this errors, because of dynamic nature of lang. And also, be ready to manually patch some libraries you're using. Don't get me wrong, i have many years of Python experience, but it's really hard to maintain it on such distributed systems like GAE, and it's really have problems with quality of code :(
Java, in other hand, works very well. In case when your code have problems, you'll see all information you need to fix this, and after few iterations you'll fix almost all bugs. Except one: sometimes you'll see startup errors :( Not too often, btw
PS btw, choosing right language for GAE depend on what language you knows betters :) If you don't know Java yet - don't start with it, it requires at least 1-2 years to understand language.
这些基准测试在(大概)标准设置上对 Python 3 和 Java 进行了比较。也没有迹象表明这些基准测试测试的是哪种类型的工作负载。
App Engine 运行 Python 2.5,其配置与标准桌面上的配置截然不同,因此基准测试实际上并不适用。
此外,可扩展性与这些基准无关——它们至多产生恒定的因素差异。如果您的应用程序是按规模构建的,那么它将以任何一种语言进行扩展,达到相同的程度。可扩展性取决于您构建应用程序和使用底层基础设施的程度。
我建议使用您最熟悉的任何语言和框架 - 不要根据基准选择您的语言。
These benchmarks compare Python 3 to Java on a (presumably) standard setup. There's no indication of what sort of workload these benchmarks test, either.
App Engine runs Python 2.5, in a decidedly different configuration to what you'd find on a standard desktop, so the benchmarks really don't apply.
Further, scalability isn't about benchmarks like these - they make, at most, a constant factor difference. If your app is built to scale, it will scale in either language, to the same degree. Scalability depends on how well you architect your app and use the underlying infrastructure.
I would recommend using whatever language and framework you're most comfortable with - don't pick your language based on benchmarks.