由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 古狗研究新出炉:C++ Is The Best Performing Language
相关主题
Sun当年设计Java的败笔Java 9 and beyond
java就是andriod慢的原因,为什么总有人要争呢? (转载)scala vs clojure ?
Java的performancejava大概还有多久才能和C++一样快呢?
Java 写的程序在server端也是在JVM上run吗?java是最好的语言
俺一直觉得C#弄个JIT挺傻逼的C++确实不适合做大项目
我来尽量客观地谈谈GC/ref count,还有RAII没觉得Java比Python和Perl有啥优点
蜥蜴和好虫掐起来了RAII和GC对应的两条技术路线
Hejlsberg比Gosling牛10倍这次vert.x 彻底输给NodeJX 了
相关话题的讨论汇总
话题: c++话题: java话题: go话题: language话题: google
进入Programming版参与讨论
1 (共1页)
t*********e
发帖数: 1136
1
C++ clear winner in Google language tests
Google has released a research paper that suggests C++ is the best-
performing programming language in the market.
The internet giant implemented a compact algorithm in four languages – C++, Java, Scala and its own programming language Go – and then benchmarked results to find "factors of difference".
"We find that in terms of performance, C++ wins out by a large margin," the paper says.
However, despite C++ trumping the others in performance, Google also
suggests that it requires the "most extensive tuning efforts, many of which were done at a level of sophistication that would not be available to the average programmer".
This compares to Java, which the paper describes as the "simplest to
implement", but also the hardest to analyse for performance.
The research found that Scala had "powerful language features", which
allowed for the "best optimisation of code complexity".
Google also ran tests on Go, a language it began developing in 2007. In May 2010, the company said that Go was being used for "real stuff", by which it probably meant distributed web services.
However, Go did not stand up too well against the more established languages, as the tests indicated that the compilers for it are "still immature", which was reflected in "both performance and binary size".
http://www.computing.co.uk/ctg/news/2076322/-winner-google-lang
g*****g
发帖数: 34805
2
The C++ tuning includes many special data structure, it can't even be
open-sourced. If I read the paper correctly, between an average C++
developer, and and average Java developer, chance is you'll get faster
code out of Java for this algorithm.

+, Java, Scala and its own programming language Go – and then benchmarked
results to find "factors of difference".
the paper says.
which were done at a level of sophistication that would not be available to
the average programmer".

【在 t*********e 的大作中提到】
: C++ clear winner in Google language tests
: Google has released a research paper that suggests C++ is the best-
: performing programming language in the market.
: The internet giant implemented a compact algorithm in four languages – C++, Java, Scala and its own programming language Go – and then benchmarked results to find "factors of difference".
: "We find that in terms of performance, C++ wins out by a large margin," the paper says.
: However, despite C++ trumping the others in performance, Google also
: suggests that it requires the "most extensive tuning efforts, many of which were done at a level of sophistication that would not be available to the average programmer".
: This compares to Java, which the paper describes as the "simplest to
: implement", but also the hardest to analyse for performance.
: The research found that Scala had "powerful language features", which

w***g
发帖数: 5958
3
显然这个"best"定义有问题。

+, Java, Scala and its own programming language Go – and then benchmarked
results to find "factors of difference".
the paper says.
which were done at a level of sophistication that would not be available to
the average programmer".

【在 t*********e 的大作中提到】
: C++ clear winner in Google language tests
: Google has released a research paper that suggests C++ is the best-
: performing programming language in the market.
: The internet giant implemented a compact algorithm in four languages – C++, Java, Scala and its own programming language Go – and then benchmarked results to find "factors of difference".
: "We find that in terms of performance, C++ wins out by a large margin," the paper says.
: However, despite C++ trumping the others in performance, Google also
: suggests that it requires the "most extensive tuning efforts, many of which were done at a level of sophistication that would not be available to the average programmer".
: This compares to Java, which the paper describes as the "simplest to
: implement", but also the hardest to analyse for performance.
: The research found that Scala had "powerful language features", which

r*********r
发帖数: 3195
4
the question is, when you first start out,
have you already decided to become an "average" coder??
of course you want to pick a path that takes you further.
M**u
发帖数: 10158
5
Google的C++规范限的很严的,他们其实不少C++的feature都禁用

+, Java, Scala and its own programming language Go – and then benchmarked
results to find "factors of difference".
the paper says.
which were done at a level of sophistication that would not be available to
the average programmer".
May 2010, the company said that Go was being used for "real stuff", by which
it probably meant distributed web services.
languages, as the tests indicated that the compilers for it are "still
immature", which was reflected in "both performance and binary size".

【在 t*********e 的大作中提到】
: C++ clear winner in Google language tests
: Google has released a research paper that suggests C++ is the best-
: performing programming language in the market.
: The internet giant implemented a compact algorithm in four languages – C++, Java, Scala and its own programming language Go – and then benchmarked results to find "factors of difference".
: "We find that in terms of performance, C++ wins out by a large margin," the paper says.
: However, despite C++ trumping the others in performance, Google also
: suggests that it requires the "most extensive tuning efforts, many of which were done at a level of sophistication that would not be available to the average programmer".
: This compares to Java, which the paper describes as the "simplest to
: implement", but also the hardest to analyse for performance.
: The research found that Scala had "powerful language features", which

z****e
发帖数: 2024
6
c/fortran 更快,几乎就是汇编了
d****p
发帖数: 685
7
You didn't read the article carefully.
The optimization techniques applied to the C++ implementation are quite well
known to average C++ coders (not to an average Java coder who doesn't know
the diff between hash_map and regular STL map :-)). And it indicates C++
does offer a chance to do such fine-tuning if needed.
Of course at most times we don't do it.
Once again, you don't miss every chance to pump the tires for Java, which is
a good programming language. But be honest please - the code produced by an
average C++ coder will run FASTER than the one produced by an average java
coder, in most cases.

to

【在 g*****g 的大作中提到】
: The C++ tuning includes many special data structure, it can't even be
: open-sourced. If I read the paper correctly, between an average C++
: developer, and and average Java developer, chance is you'll get faster
: code out of Java for this algorithm.
:
: +, Java, Scala and its own programming language Go – and then benchmarked
: results to find "factors of difference".
: the paper says.
: which were done at a level of sophistication that would not be available to
: the average programmer".

y**********u
发帖数: 6366
8
怎么可能呢
再烂的Java coder也知道Java没有STL map,有TreeMap和HashMap

well
know
is
an
java
benchmarked

【在 d****p 的大作中提到】
: You didn't read the article carefully.
: The optimization techniques applied to the C++ implementation are quite well
: known to average C++ coders (not to an average Java coder who doesn't know
: the diff between hash_map and regular STL map :-)). And it indicates C++
: does offer a chance to do such fine-tuning if needed.
: Of course at most times we don't do it.
: Once again, you don't miss every chance to pump the tires for Java, which is
: a good programming language. But be honest please - the code produced by an
: average C++ coder will run FASTER than the one produced by an average java
: coder, in most cases.

h*d
发帖数: 19309
9
C rules
a****l
发帖数: 8211
10
this shows google really has nothing better to do than throwing more fuel to
the flame war.

+, Java, Scala and its own programming language Go – and then benchmarked
results to find "factors of difference".
the paper says.
which were done at a level of sophistication that would not be available to
the average programmer".

【在 t*********e 的大作中提到】
: C++ clear winner in Google language tests
: Google has released a research paper that suggests C++ is the best-
: performing programming language in the market.
: The internet giant implemented a compact algorithm in four languages – C++, Java, Scala and its own programming language Go – and then benchmarked results to find "factors of difference".
: "We find that in terms of performance, C++ wins out by a large margin," the paper says.
: However, despite C++ trumping the others in performance, Google also
: suggests that it requires the "most extensive tuning efforts, many of which were done at a level of sophistication that would not be available to the average programmer".
: This compares to Java, which the paper describes as the "simplest to
: implement", but also the hardest to analyse for performance.
: The research found that Scala had "powerful language features", which

相关主题
我来尽量客观地谈谈GC/ref count,还有RAIIJava 9 and beyond
蜥蜴和好虫掐起来了scala vs clojure ?
Hejlsberg比Gosling牛10倍java大概还有多久才能和C++一样快呢?
进入Programming版参与讨论
g*****g
发帖数: 34805
11
You sound bitter and defensive. Since when google proprietary data
structure is known by average C++ coder? You did read the part that
they couldn't even open source the C++ optimized version because of that,
did you?
C++ outperforms Java is no news, it's news when their
vanilla verison of C++ was outperformed by vanilla version of Java
by a good margin. Obviously it takes a team of google engineers to
do the C++ optimization with siginificant efforts, as reported in the
paper. Many of those technicals can also be used on Java as well, they just
didn't do it, that's also documented in the paper.
For less cost and less time, an average Java coder like me can hook
the vanilla java version onto a framework like Hadoop, throw it on a bunch
of linux boxes, and get better performance out of it. Of course not
every problem domain works this way, e.g. Kernel, DB engine. But most
applications do. Maybe the better question is, indeed C++ performs with
fine-tuning, but does it scale? What matters in the industry is not how
performant you can boast on a single machine, but how quick and cheap you
can
get for a solution with required performance.

well
know
is
an
java

【在 d****p 的大作中提到】
: You didn't read the article carefully.
: The optimization techniques applied to the C++ implementation are quite well
: known to average C++ coders (not to an average Java coder who doesn't know
: the diff between hash_map and regular STL map :-)). And it indicates C++
: does offer a chance to do such fine-tuning if needed.
: Of course at most times we don't do it.
: Once again, you don't miss every chance to pump the tires for Java, which is
: a good programming language. But be honest please - the code produced by an
: average C++ coder will run FASTER than the one produced by an average java
: coder, in most cases.

b******n
发帖数: 592
12
it is said C++ performs the best on this task among four languages..
It is always better to understand more languages and choose the right one
for each task. Also, if you know one language better, you probably
do better programming with it.. not mch information here
C++'s performance advantage is pretty well-know..

+, Java, Scala and its own programming language Go – and then benchmarked
results to find "factors of difference".
the paper says.
which were done at a level of sophistication that would not be available to
the average programmer".

【在 t*********e 的大作中提到】
: C++ clear winner in Google language tests
: Google has released a research paper that suggests C++ is the best-
: performing programming language in the market.
: The internet giant implemented a compact algorithm in four languages – C++, Java, Scala and its own programming language Go – and then benchmarked results to find "factors of difference".
: "We find that in terms of performance, C++ wins out by a large margin," the paper says.
: However, despite C++ trumping the others in performance, Google also
: suggests that it requires the "most extensive tuning efforts, many of which were done at a level of sophistication that would not be available to the average programmer".
: This compares to Java, which the paper describes as the "simplest to
: implement", but also the hardest to analyse for performance.
: The research found that Scala had "powerful language features", which

i*****g
发帖数: 27
13
only morons like to defend java because they can't learn c++ well.
z***e
发帖数: 5393
14
...
有人给我解释一下么?我水平比较低,不是很清楚为啥C++ performance比java强也可
以发paper了...难道以前有人认为c++ performance不如java??
N********n
发帖数: 8363
15

Using C++ outside of the system-level world is like going into a battle
field with an axe while everyone else either uses machine-gun-JAVA or
assault-rifle-C#, "Wow those other morons are weak. I am the only one
skillful enough to fight with an axe. I am so special."

【在 i*****g 的大作中提到】
: only morons like to defend java because they can't learn c++ well.
M**u
发帖数: 10158
16
most system-level don't use C++...

【在 N********n 的大作中提到】
:
: Using C++ outside of the system-level world is like going into a battle
: field with an axe while everyone else either uses machine-gun-JAVA or
: assault-rifle-C#, "Wow those other morons are weak. I am the only one
: skillful enough to fight with an axe. I am so special."

j*******d
发帖数: 8834
17

an
java
yeah and have memory leaks that avg java coder probably does not even know
how to create :p
i think c++ is in a pretty 'interesting' position today, for hardcore
performance tasks, like kernel, db engines, C is still pretty much the
choice, while for higher level stuff, there is java.
c++ vs java is just like old time vi vs emacs
it will just never go away.

【在 d****p 的大作中提到】
: You didn't read the article carefully.
: The optimization techniques applied to the C++ implementation are quite well
: known to average C++ coders (not to an average Java coder who doesn't know
: the diff between hash_map and regular STL map :-)). And it indicates C++
: does offer a chance to do such fine-tuning if needed.
: Of course at most times we don't do it.
: Once again, you don't miss every chance to pump the tires for Java, which is
: a good programming language. But be honest please - the code produced by an
: average C++ coder will run FASTER than the one produced by an average java
: coder, in most cases.

e****d
发帖数: 895
18
It's more like a comparison between SLR and autofocus compact camera.

【在 N********n 的大作中提到】
:
: Using C++ outside of the system-level world is like going into a battle
: field with an axe while everyone else either uses machine-gun-JAVA or
: assault-rifle-C#, "Wow those other morons are weak. I am the only one
: skillful enough to fight with an axe. I am so special."

w***g
发帖数: 5958
19
东方不败:你有科学,我有神功。只要炼成神功,C++也是可以上战场的。再看一眼版
名,发现真的合适的很。

【在 N********n 的大作中提到】
:
: Using C++ outside of the system-level world is like going into a battle
: field with an axe while everyone else either uses machine-gun-JAVA or
: assault-rifle-C#, "Wow those other morons are weak. I am the only one
: skillful enough to fight with an axe. I am so special."

n*****3
发帖数: 1584
20
I am not an expert too;
But since just in time compiling, with the benefit of JVM,
it does some optimization in the real situation; which c++/ machine
level code can never achieve.
BTW nobody does some VM for c++, then optimistic it before compile it with
gcc/...


【在 z***e 的大作中提到】
: ...
: 有人给我解释一下么?我水平比较低,不是很清楚为啥C++ performance比java强也可
: 以发paper了...难道以前有人认为c++ performance不如java??

相关主题
java是最好的语言RAII和GC对应的两条技术路线
C++确实不适合做大项目这次vert.x 彻底输给NodeJX 了
没觉得Java比Python和Perl有啥优点有时候我很好奇这些古怪的思想是怎么来的
进入Programming版参与讨论
s**********o
发帖数: 197
21
这个比喻太好了。相比C/C++,java。net更注重协同作战的能力。由于应用领域不同,
相同水平的程序员在C/C++的领域内会可能感觉更自由些。另外我最近学Java,感觉
Java对初学OOP的人来说比C++强许多。学Java一开始就能接触好多程序设计模式上的知
识,让你感觉不是在专门学某种语言,而是学编程本身。相反C++开始学的时候要了解
好多和语言相关的细节,一个运算符重载就可能扯出一堆内存分配效率的问题;可是当
你去写好多行程序的时候,很少人会follow当初学的那些细节问题,比如你在C++里写
new的时候根本不会去想你将来程序运行的系统是怎么地址对齐。但网上C++的教程和面
试问题又很喜欢和这些东西联系起来。

【在 N********n 的大作中提到】
:
: Using C++ outside of the system-level world is like going into a battle
: field with an axe while everyone else either uses machine-gun-JAVA or
: assault-rifle-C#, "Wow those other morons are weak. I am the only one
: skillful enough to fight with an axe. I am so special."

z***e
发帖数: 5393
22
the only performance benefit of JVM I can think about is the automatic
memory pool, but it's on the assumption that the comparable C++ code doesn't
give a well designed memory pool solution.
what else optimization can JVM do better? someone above says most C++
programmers don't know how to embed SSE asm code anyway...who says C++
programmers need to know SSE code? What's the compiler's job anyway? Those
guys surely never learned about compiler optimization.
Even for serialization/reflection, what's the big deal? It's just a data
contract. It doesn't look so nice as in Java, but you can still do the same
job whatever serialization/reflection can complete.

【在 n*****3 的大作中提到】
: I am not an expert too;
: But since just in time compiling, with the benefit of JVM,
: it does some optimization in the real situation; which c++/ machine
: level code can never achieve.
: BTW nobody does some VM for c++, then optimistic it before compile it with
: gcc/...
:

r*********r
发帖数: 3195
23
语言是语言,教学是教学,不是一码事。
教课的有问题不等于语言本身有问题,你的,明白?
另外, oop 二十年前被当成宝,现在没人稀罕。

【在 s**********o 的大作中提到】
: 这个比喻太好了。相比C/C++,java。net更注重协同作战的能力。由于应用领域不同,
: 相同水平的程序员在C/C++的领域内会可能感觉更自由些。另外我最近学Java,感觉
: Java对初学OOP的人来说比C++强许多。学Java一开始就能接触好多程序设计模式上的知
: 识,让你感觉不是在专门学某种语言,而是学编程本身。相反C++开始学的时候要了解
: 好多和语言相关的细节,一个运算符重载就可能扯出一堆内存分配效率的问题;可是当
: 你去写好多行程序的时候,很少人会follow当初学的那些细节问题,比如你在C++里写
: new的时候根本不会去想你将来程序运行的系统是怎么地址对齐。但网上C++的教程和面
: 试问题又很喜欢和这些东西联系起来。

r*********r
发帖数: 3195
24
java, c# 的 assault-rifle, machine-gun 在哪里?
如果是指可调用的库比较多的话,你应该看看 boost,c++ 的 de facto standard
library,免费,公开,高质量。java/c# 根本没法比。
g*****g
发帖数: 34805
25

't
Since JIT operates at runtime, it can get dynamic information that's not
available in compile time. e.g. JIT can detect a section that's hot and
do some optimization like inlining, or move code out of loop. That's not
saying well tuned C++ code won't be on par or better, but it can easily
outperform untuned C++ code in many cases.
same
This is a big deal. It makes it very easy to communicate between
servers or client/server. It also makes it possible to discover
service/interface in runtime. Without it, it wouldn't be possible
to do things like Aspect Oriented Programming. C/C++ can't do AOP
without language extension.

【在 z***e 的大作中提到】
: the only performance benefit of JVM I can think about is the automatic
: memory pool, but it's on the assumption that the comparable C++ code doesn't
: give a well designed memory pool solution.
: what else optimization can JVM do better? someone above says most C++
: programmers don't know how to embed SSE asm code anyway...who says C++
: programmers need to know SSE code? What's the compiler's job anyway? Those
: guys surely never learned about compiler optimization.
: Even for serialization/reflection, what's the big deal? It's just a data
: contract. It doesn't look so nice as in Java, but you can still do the same
: job whatever serialization/reflection can complete.

s**********o
发帖数: 197
26
真的假的?那现在公司里用啥?

【在 r*********r 的大作中提到】
: 语言是语言,教学是教学,不是一码事。
: 教课的有问题不等于语言本身有问题,你的,明白?
: 另外, oop 二十年前被当成宝,现在没人稀罕。

g*****g
发帖数: 34805
27

Automatic memory reclamation alone doubles your productivity with
way less memory leak issues and no dangling pointers that can lead to
disaster in production environment. Serialization/reflection are just
icing on cake.
You can count boost as part of standard C++ library and it's still no
competition to JDK. Let's try a few here that's in JDK. platform security,
introspection, dynamic class loading, naming services (e.g. LDAP),
cryptography, security services (e.g. Kerberos), print services,
and web services. Let's not even go to 3rd party here.

【在 r*********r 的大作中提到】
: java, c# 的 assault-rifle, machine-gun 在哪里?
: 如果是指可调用的库比较多的话,你应该看看 boost,c++ 的 de facto standard
: library,免费,公开,高质量。java/c# 根本没法比。

z***e
发帖数: 5393
28
但是JIT要做这些runtime优化,本身也有cost,不能不考虑进去吧。
而且java自己的overhead这么多,比如没有struct而必须是class,而每个class都有很
多额外的property,这些都要考虑进去之后,它那点优化也难说到底有什么作用。而且
JIT优化,OS自己也有优化,到底JIT的优化能起多大作用也难说。比如说new/delete,
也并不是OS随便找块memroy给你折腾,同样OS本身也是有优化的。
后面那些我都觉得是对的,java本身就是提供更方便灵活的开发/coding模式,但是非
要跟C++比performance就扯了...还要发paper来分析,说明google开始养闲人了。

【在 g*****g 的大作中提到】
:
: Automatic memory reclamation alone doubles your productivity with
: way less memory leak issues and no dangling pointers that can lead to
: disaster in production environment. Serialization/reflection are just
: icing on cake.
: You can count boost as part of standard C++ library and it's still no
: competition to JDK. Let's try a few here that's in JDK. platform security,
: introspection, dynamic class loading, naming services (e.g. LDAP),
: cryptography, security services (e.g. Kerberos), print services,
: and web services. Let's not even go to 3rd party here.

g*****g
发帖数: 34805
29

Sure, but on a hot section that's run many times, it's negligible.
As I said, well-tuned Java will never outperform well-tuned C++ code,
but vanilla Java code can outperform vanilla C++ code in some cases due to
JIT optimazation, as seen in the paper.
And well-tuned C++ code is only 2-3X faster than
well-tuned Java in most comparisons, with twice or more efforts required.
These make C++'s TCO higher than Java in most applications. TCO determines
what language to choose in most cases.

【在 z***e 的大作中提到】
: 但是JIT要做这些runtime优化,本身也有cost,不能不考虑进去吧。
: 而且java自己的overhead这么多,比如没有struct而必须是class,而每个class都有很
: 多额外的property,这些都要考虑进去之后,它那点优化也难说到底有什么作用。而且
: JIT优化,OS自己也有优化,到底JIT的优化能起多大作用也难说。比如说new/delete,
: 也并不是OS随便找块memroy给你折腾,同样OS本身也是有优化的。
: 后面那些我都觉得是对的,java本身就是提供更方便灵活的开发/coding模式,但是非
: 要跟C++比performance就扯了...还要发paper来分析,说明google开始养闲人了。

r*********r
发帖数: 3195
30

to
just
哪有那么多 memory leak。现在都用 stl,reference, 很少有内存泄漏。
no
security,
ok, introspection 算是吧。crypto 的库估计就是拿c 库包装一下。java 库最大的问题
是,如果你不满足于文档,想看看源代码是怎么写的,多半看到的 native method.
再往下就又是 c, c++,这不是兜圈子嘛。 jdk 里很多代码我看过,和系统相关的都是
这种情况。
web services 么,servlet 设计有问题。小点的用 python-django, ruby on
rails,
cakephp 什么的快多了。要高性能的,复杂的,用asio/pion 搭一个backend,也很快。

【在 g*****g 的大作中提到】
:
: Sure, but on a hot section that's run many times, it's negligible.
: As I said, well-tuned Java will never outperform well-tuned C++ code,
: but vanilla Java code can outperform vanilla C++ code in some cases due to
: JIT optimazation, as seen in the paper.
: And well-tuned C++ code is only 2-3X faster than
: well-tuned Java in most comparisons, with twice or more efforts required.
: These make C++'s TCO higher than Java in most applications. TCO determines
: what language to choose in most cases.

相关主题
pixie - Clojure寄生在C环境java就是andriod慢的原因,为什么总有人要争呢? (转载)
關於JVM多線程的內存分配Java的performance
Sun当年设计Java的败笔Java 写的程序在server端也是在JVM上run吗?
进入Programming版参与讨论
g*****g
发帖数: 34805
31

程序稍微大一点,根本不是有没有的问题,而是多严重的问题。客户端一个
应用,漏一点大约也没事。服务器端哪怕1K的泄漏,跑一天都可能把机器整趴
了。再说这个悬挂指针/指针越界,有VM的也就抛个exception了事,影响一个
操作,C++就直接core dump退出了,多用户环境差别大了。
问题
我老做了这么多年Java程序员,需要看Java源码的时候不多。需要看C/C++源码
的问题都是我解决不了的,以其看源码不如google看哪个版本JDK fix没有。
至于我说的那些库,你一会C一会python的,这些不在boost里,不是标准库,
甚至不是C++,我没说错吧?不是标准库,移植就很成问题,特别对C/C++这
种基本类型的长度和方向都没有定义的。

【在 r*********r 的大作中提到】
:
: to
: just
: 哪有那么多 memory leak。现在都用 stl,reference, 很少有内存泄漏。
: no
: security,
: ok, introspection 算是吧。crypto 的库估计就是拿c 库包装一下。java 库最大的问题
: 是,如果你不满足于文档,想看看源代码是怎么写的,多半看到的 native method.
: 再往下就又是 c, c++,这不是兜圈子嘛。 jdk 里很多代码我看过,和系统相关的都是
: 这种情况。

r*********r
发帖数: 3195
32
asio就是boost里的。可移植性嘛,比java好一点点吧。java库版本冲突问题太大,
可移植性其实很差。所以才搞出来 maven 这种怪物。
g*****g
发帖数: 34805
33
我提了那么多,你拿个async IO就来糊弄了?
说到移植性,版本冲突是会出问题,但绝对
不是你说的那么夸张。Maven更是用来管理
第三方类库的,如果光JDK根本用不着Maven。
我老刚才数了手头一个项目,源文件不超过100个,154个第三方jar,
一个C++项目要是有这么多第三方代码能跑起来都是奇迹。

【在 r*********r 的大作中提到】
: asio就是boost里的。可移植性嘛,比java好一点点吧。java库版本冲突问题太大,
: 可移植性其实很差。所以才搞出来 maven 这种怪物。

r*********r
发帖数: 3195
34
你不读 jdk 的源码,所以认识不到 jdk 的局限性啊。
r*********r
发帖数: 3195
35
maven 的用处就是解决版本冲突。解决的方法很暴力:需要什么版本就下载什么版本。
所以某个库有可能 1.1, 1.2, ... 1.10 同时存在。
r*********r
发帖数: 3195
36
asio 可不只是 async io,而是基本上包括了所有 c++ network programming。
用来做 web services 也是牛刀小试。
g*****g
发帖数: 34805
37
这有问题吗?好歹能解决。C++的第三方库,没源码不能重新编译
能用的都不多。就算有源码吧,让你写个有100个第三方库的makefile,
你不得哭死。

【在 r*********r 的大作中提到】
: maven 的用处就是解决版本冲突。解决的方法很暴力:需要什么版本就下载什么版本。
: 所以某个库有可能 1.1, 1.2, ... 1.10 同时存在。

r*********r
发帖数: 3195
38
what? shocking ! linux 成千上万的 package, 用 c/c++ 写的
都可以直接拿来用。 include 一下头文件,link 一下 .so 就可以了。

【在 g*****g 的大作中提到】
: 这有问题吗?好歹能解决。C++的第三方库,没源码不能重新编译
: 能用的都不多。就算有源码吧,让你写个有100个第三方库的makefile,
: 你不得哭死。

g*****g
发帖数: 34805
39
这叫第三方的库吗?

【在 r*********r 的大作中提到】
: what? shocking ! linux 成千上万的 package, 用 c/c++ 写的
: 都可以直接拿来用。 include 一下头文件,link 一下 .so 就可以了。

r*********r
发帖数: 3195
40
掏钱的才算?

【在 g*****g 的大作中提到】
: 这叫第三方的库吗?
相关主题
Java 写的程序在server端也是在JVM上run吗?蜥蜴和好虫掐起来了
俺一直觉得C#弄个JIT挺傻逼的Hejlsberg比Gosling牛10倍
我来尽量客观地谈谈GC/ref count,还有RAIIJava 9 and beyond
进入Programming版参与讨论
g*****g
发帖数: 34805
41
你能拿到windows上,都不用编译就能用的可以算。
否则还谈啥移植性。我这154个jar都是maven从第三方网站
直接当下来的,windows/linux都能跑。

【在 r*********r 的大作中提到】
: 掏钱的才算?
r*********r
发帖数: 3195
42
你把可移植性和 jvm 混为一谈了。
r****y
发帖数: 26819
43
本版经典主题之一啊。

+, Java, Scala and its own programming language Go – and then benchmarked
results to find "factors of difference".
the paper says.
which were done at a level of sophistication that would not be available to
the average programmer".

【在 t*********e 的大作中提到】
: C++ clear winner in Google language tests
: Google has released a research paper that suggests C++ is the best-
: performing programming language in the market.
: The internet giant implemented a compact algorithm in four languages – C++, Java, Scala and its own programming language Go – and then benchmarked results to find "factors of difference".
: "We find that in terms of performance, C++ wins out by a large margin," the paper says.
: However, despite C++ trumping the others in performance, Google also
: suggests that it requires the "most extensive tuning efforts, many of which were done at a level of sophistication that would not be available to the average programmer".
: This compares to Java, which the paper describes as the "simplest to
: implement", but also the hardest to analyse for performance.
: The research found that Scala had "powerful language features", which

t*********e
发帖数: 1136
44
我觉得最大问题还是Java不开源。基本上大家只有一个JVM用。这个JVM还是受Oracle控
制的。
当然C++至少在Linux上也是gcc一统天下。但是开源让很多人有机会去改进。而且生成
的汇编代码厂商如Intel,AMD可以看,可以提意见。JVM就没那么容易了。
z***e
发帖数: 5393
45
开源就死定了。Linux开源,动kernel的有几个?能改改tcp/ip的都没几个。其它无非是
加点各种可有可无的支持。JVM开源,能动手改的有几个?

【在 t*********e 的大作中提到】
: 我觉得最大问题还是Java不开源。基本上大家只有一个JVM用。这个JVM还是受Oracle控
: 制的。
: 当然C++至少在Linux上也是gcc一统天下。但是开源让很多人有机会去改进。而且生成
: 的汇编代码厂商如Intel,AMD可以看,可以提意见。JVM就没那么容易了。

g*****g
发帖数: 34805
46
Java当然是开源的,唯一的问题是compatibility kit,
你可以fork,但oracle不赞同,你不能叫他java。
可以看Apache Harmony,就是这样的存在。

【在 t*********e 的大作中提到】
: 我觉得最大问题还是Java不开源。基本上大家只有一个JVM用。这个JVM还是受Oracle控
: 制的。
: 当然C++至少在Linux上也是gcc一统天下。但是开源让很多人有机会去改进。而且生成
: 的汇编代码厂商如Intel,AMD可以看,可以提意见。JVM就没那么容易了。

r********3
发帖数: 2998
47
STL的Map是红黑树是实现的,本质上就是二叉树。
我个人觉得HashMap还是更好一些。
另外,HashTable是线程安全的,STL的数据结构没有。

【在 y**********u 的大作中提到】
: 怎么可能呢
: 再烂的Java coder也知道Java没有STL map,有TreeMap和HashMap
:
: well
: know
: is
: an
: java
: benchmarked

r********3
发帖数: 2998
48
赞!!!说到点子上了。
版主可以把这个回帖加入精华帖了。

't
same

【在 z***e 的大作中提到】
: the only performance benefit of JVM I can think about is the automatic
: memory pool, but it's on the assumption that the comparable C++ code doesn't
: give a well designed memory pool solution.
: what else optimization can JVM do better? someone above says most C++
: programmers don't know how to embed SSE asm code anyway...who says C++
: programmers need to know SSE code? What's the compiler's job anyway? Those
: guys surely never learned about compiler optimization.
: Even for serialization/reflection, what's the big deal? It's just a data
: contract. It doesn't look so nice as in Java, but you can still do the same
: job whatever serialization/reflection can complete.

t****k
发帖数: 5662
49
forth秒杀一切牛鬼蛇神
g*****g
发帖数: 34805
50
Savvy Java developer should never use HashTable.
ConcurrentHashMap is much more efficient.

【在 r********3 的大作中提到】
: STL的Map是红黑树是实现的,本质上就是二叉树。
: 我个人觉得HashMap还是更好一些。
: 另外,HashTable是线程安全的,STL的数据结构没有。

相关主题
scala vs clojure ?C++确实不适合做大项目
java大概还有多久才能和C++一样快呢?没觉得Java比Python和Perl有啥优点
java是最好的语言RAII和GC对应的两条技术路线
进入Programming版参与讨论
r********3
发帖数: 2998
51
恩,concurrrency包好像是Java 1.5才引入的。
ConcurrentHashMap的确是高手才能写出来的,锁的粒度很低。 HashTable好像是任何
操作都是锁整个table?

【在 g*****g 的大作中提到】
: Savvy Java developer should never use HashTable.
: ConcurrentHashMap is much more efficient.

f******y
发帖数: 2971
52
In C++, you can use tbb::concurrent_hash_map, which is both hash map and
thread safe.

【在 r********3 的大作中提到】
: STL的Map是红黑树是实现的,本质上就是二叉树。
: 我个人觉得HashMap还是更好一些。
: 另外,HashTable是线程安全的,STL的数据结构没有。

j*******7
发帖数: 6300
53
I used to be a C++ programmer but have not been for many years. As for
developing GUI app on Linux/Unix platform, I find most people prefer C++/Qt
to Java/SWT/Swing. I guess Java should still be preferred for server app
without GUI.
d***q
发帖数: 1119
54
for these years, Qt is the only available product for cross-platform. other
solutions may have some drawbacks in terms of deployment and development.

Qt

【在 j*******7 的大作中提到】
: I used to be a C++ programmer but have not been for many years. As for
: developing GUI app on Linux/Unix platform, I find most people prefer C++/Qt
: to Java/SWT/Swing. I guess Java should still be preferred for server app
: without GUI.

y****e
发帖数: 23939
55
这么搞不是跟写汇编差不多了吧

to

【在 g*****g 的大作中提到】
: The C++ tuning includes many special data structure, it can't even be
: open-sourced. If I read the paper correctly, between an average C++
: developer, and and average Java developer, chance is you'll get faster
: code out of Java for this algorithm.
:
: +, Java, Scala and its own programming language Go – and then benchmarked
: results to find "factors of difference".
: the paper says.
: which were done at a level of sophistication that would not be available to
: the average programmer".

1 (共1页)
进入Programming版参与讨论
相关主题
这次vert.x 彻底输给NodeJX 了俺一直觉得C#弄个JIT挺傻逼的
有时候我很好奇这些古怪的思想是怎么来的我来尽量客观地谈谈GC/ref count,还有RAII
pixie - Clojure寄生在C环境蜥蜴和好虫掐起来了
關於JVM多線程的內存分配Hejlsberg比Gosling牛10倍
Sun当年设计Java的败笔Java 9 and beyond
java就是andriod慢的原因,为什么总有人要争呢? (转载)scala vs clojure ?
Java的performancejava大概还有多久才能和C++一样快呢?
Java 写的程序在server端也是在JVM上run吗?java是最好的语言
相关话题的讨论汇总
话题: c++话题: java话题: go话题: language话题: google