Content deleted Content added
→Program speed Collections bullet point: new section |
|||
Line 228:
::Or sometimes they give time limits separate for each problem, like that: http://opencup.ru/files/oca/gp1/problems-e.pdf - where time limits for Java solutions of problems C,D,G,I are 1.75-3.5 times more...[[User:Alliumnsk|Alliumnsk]] ([[User talk:Alliumnsk|talk]]) 07:18, 13 November 2011 (UTC)
: I suggest you to read the references first. Dates: The first one, says ''This entry was posted by connect4 on Tuesday, June 8th, 2010 at 12:40 pm. '' at its bottom. In the second one, if you happen to get through first sentence, you can see date February, 2 2009, which indicates the source is newer that that, which doesn't fit into "5+ years" you mentioned. Now, would you delete links to Dr.Dobbs which are 6 years old? [[User:Alliumnsk|Alliumnsk]] ([[User talk:Alliumnsk|talk]]) 06:54, 13 November 2011 (UTC)
== Program speed Collections bullet point ==
I'm going to remove this bullet point from the Program speed section for now:
<blockquote>
Collections,[50][51] Heap allocation, as well as method calls[52] are much better in Java than in C++.
</blockquote>
because, looking at the cited article, I think the word "collections" there is a misleading characterisation, but I'm not sure the correct way to reword it. The most obvious thing is that the cited graphs aren't comparing collections performance in general, it's specifically looking at HashMaps. But I don't think changing it from "Collections" to "HashMaps" would be enough.
The code the author provides shows that that test consists of two loops which: allocate memory off the heap, convert an integer into a string, do a hash-table lookup or insert, and then deallocate the memory. There's no way the hash-table lookups make up more than a fraction of the time for that in either language. Also, in the C++ benchmark, the integer conversion is done using generic IO routines, while the Java benchmark uses an integer-to-string function. So the actual performance comparison is with heap allocation and C++ I/O routines vs. Java string conversions. That's a pretty complex and highly-specific thing to put in that bullet point in place of "Collections."
I figured I'd [[WP:BOLD|be bold]] in removing the misleading bit, but let the more involved editors make a judgement call on how to fix it. Personally, I think "Collections" should just be removed from the bullet point, because going from "heap allocation, I/O routines, string conversions, and hash maps" to "collections" seems like a bit of [[WP:OR|original research]] to me. (The [52] graph also looks far too close to justify saying "much better," especially since the C++ compilers fall between the server JVM and client JVM.)
More broadly, though, regarding using that article as a source here, it may be worth reconsidering whether the cited article actually says what's being attributed to it. The author deliberately chooses not to analyse or explain the results. If we use those graphs to assert that one language is faster than another in some case, we're choosing to interpret the results ourselves. [[User:BMKane|BMKane]] ([[User talk:BMKane|talk]]) 20:33, 25 November 2011 (UTC)
|