TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Java IAQ

75 点作者 Mitt大约 13 年前

9 条评论

krrose27大约 13 年前
Goes directly to "What other operations are surprisingly slow?" and attempts to write micro benchmark with the same results.<p>Fails....<p>Most of the general stuff is accurate and dandy but I don't believe you should listen to many (most likely any) of the speed related statements as this article appears to have been written in 1998.<p>Topic should be "Java IAQ circa 1998".
nailer大约 13 年前
I have an IAQ of my own:<p>Why is it that Java VMs seem to have such different interactive latency when compared to other memory-managed language VMs? Is the performance of eg, eclipse or Android or the Java browser plugin something to with the GC kicking in too aggressively?<p>Over the last decade I've heard different explanations re: SWT/swing/AWT toolkits, and server-side optimizations being default in desktop VMs, but I'm fairly sure both issues should be resolved now. Nevertheless, my general experience seems to be if it's Java based, it seems to handle touch/mouse events noticeably worse than otherwise.<p>Maybe .net and Python and the rest are doing more of their UI work in C?
评论 #3838289 未加载
评论 #3838679 未加载
评论 #3839374 未加载
评论 #3838784 未加载
smackfu大约 13 年前
If you are interested in this kind of stuff, Effective Java is a must-read book. Long, good explanations of how to do stuff right.<p>Also, the 2nd edition covers up through Java 1.6.
评论 #3838656 未加载
js2大约 13 年前
FWIW, last changed July 13, 1998 according to the source.
peeters大约 13 年前
This appears to have been written before IDEs were invented. The author suggests that it's acceptable to extend a class just to gain unqualified access to its static methods to save a few characters of typing.
评论 #3836932 未加载
评论 #3841050 未加载
typicalrunt大约 13 年前
<i>Java compilers are very poor at lifting constant expressions out of loops. The C/Java for loop is a bad abstraction, because it encourages re-computation of the end value in the most typical case. So for(int i=0; i&#60;str.length(); i++) is three times slower than int len = str.length(); for(int i=0; i&#60;len; i++)</i><p>Does anyone know if this is still valid advice? I recall reading somewhere that the JIT has optimized around this problem.
评论 #3838834 未加载
评论 #3837321 未加载
评论 #3838471 未加载
typicalrunt大约 13 年前
<i>But note the warning from Sun: "So when should you use static import? Very sparingly!"</i><p>I'm so glad there is an authoritative answer on this subject. IMHO, I hate the use of static imports because it becomes difficult to know where a particular method comes from... where it's an instance method from the class itself or one that is brought in through a static import.<p>And then there's the possibility of clobbering the namespace by including a local variable name and a statically imported variable.
评论 #3837544 未加载
评论 #3841030 未加载
KonradKlause大约 13 年前
The page links also to a C IAQ: <a href="http://www.seebs.net/faqs/c-iaq.html" rel="nofollow">http://www.seebs.net/faqs/c-iaq.html</a><p>I've never seen that many wrong C statements. :-)
lucian1900大约 13 年前
A little outdated, the one about HashMaps and equals is moot with generics.<p>Still quite interesting.
评论 #3836621 未加载
评论 #3836485 未加载
评论 #3836805 未加载