Mar. 6th, 2005

juan_gandhi: (Default)
Последнее время что-то я решил отписываться от людей, которые пишут гадости про других людей, которых я уважаю. Это лишь означает, что я их читать не буду; никого я не баню и пока не планирую, даже анонимных придурков - они прекрасно иллюстрируют не только сами себя, но и целую идеологию - не видел ещё анонимного противника смертной казни или анонимного сторонника свободы слова.
juan_gandhi: (Default)
case 1: nothing; case 2: calling declared nonfinal method; case 3: calling declared final method... etc. See code at the bottom for details. The test works like this: First, it 500 times repeats the following 1000000 calles of each method. Results are ignored. Then it does the same, but 1000 times.

Table 1: Java 5. java version "1.5.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-rc-b63)
Java HotSpot(TM) Client VM (build 1.5.0-rc-b63, mixed mode, sharing)

8.902 nano for nop (1000000000 attempts).
19.077 nano for nonfinal declared (a.a) (1000000000 attempts).
18.054 nano for final declared (a.b) (1000000000 attempts).
17.662 nano for nonfinal inherited (b.a) (1000000000 attempts).
18.194 nano for final inherited (b.b) (1000000000 attempts).
17.711 nano for final declared (b.c) (1000000000 attempts).
17.424 nano for nonfinal inherited (c.a) (1000000000 attempts).
18.126 nano for final inherited (c.b) (1000000000 attempts).
8.837 nano for nop (1000000000 attempts).

Table 2. java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

9.033 nano for nop (1000000000 attempts).
40.333 nano for nonfinal declared (a.a) (1000000000 attempts).
40.257 nano for final declared (a.b) (1000000000 attempts).
32.947 nano for nonfinal inherited (b.a) (1000000000 attempts).
32.871 nano for final inherited (b.b) (1000000000 attempts).
32.75 nano for final declared (b.c) (1000000000 attempts).
32.636 nano for nonfinal inherited (c.a) (1000000000 attempts).
32.958 nano for final inherited (c.b) (1000000000 attempts).
8.743 nano for nop (1000000000 attempts).


(turned out I do not have 1.3.1 installed; and it hardly makes any sense to use any other version - 1.2.x, 1.3.0, 1.4.0).

Read more... )

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

August 2025

S M T W T F S
      12
3456789
10 11 12 13141516
171819 20212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 21st, 2025 08:09 am
Powered by Dreamwidth Studios