@andywestken: Concluding on performance from the program dependencies is a big wtf to me.
moorecm wrote: Memory leaks, just like other bugs, are an absolute certainty as code size increases. Testers should have the mindset that if they aren't finding bugs, they aren't doing their job, IMO. |
xander337 wrote: Speaking of memory leaks... I gotta give it to notch. Only a truly skilled programmer can introduce such a massive memory leak in a garbage collected environment (the first desktop alpha of minecraft had it pretty bad xD) |
|
|
Run time: 11.36 |
|
|
Run time: 69.12 |
|
|
Static call run time: 0 n: 1410065408 Virtual call run time: 34.01 n: -1474836480 |
|
|
Static call run time: 22.981 n: 1410065408 Virtual call run time: 74.487 n: -1474836480 |
Java primitive Run time: 7.616 C++ primitive Run time: 7.02 |
|
|
Static call run time: 23.052 n: 1410065408 Virtual call run time: 26.907 n: 1410065408 |
Static call run time: 23.246 n: 1410065408 Virtual call run time: 23.323 n: 1410065408 |
For since Java auto-initialize default values for primitive for which C++ does not, I added below line into sample code to make it more equivalent. for(int i = 0; i < PTR_NUM; ++i) { ptrv[i] = new char[(i % 1023) + 1]; *(ptrv[i]) = '0'; //add this line to explicitly default some values } |
Hi rapidcoder what is your timing for the primitive type memory allocation ? |
rapidcoder wrote: |
---|
Whatever it is, such benchmarks are by definition flawed, because they are very far model from what is really done by useful applications. I mean, probably no real application allocates blocks of memory in such a predictable way (just to delete it immediately after) nor calls the same empty method of the same object in a loop. |
|
|
Run time: 10.24 |
|
|
Run time: 3.723 |
Your hardware is much faster than mine. |
I am using an AMD Turion 64 Mobile technology ML-32 1.8GHz in 32 bit mode. Java is definitely Oracle (Sun) java version "1.6.0_23" Java(TM) SE Runtime Environment (build 1.6.0_23-b05) Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing) |