TEXT   36

results-vm

Guest on 26th July 2022 01:01:21 AM

  1. Integer Speed Test
  2.         integer ops in a loop 1234567 times
  3.         tests integer op speed and looping speed
  4.         is O(n) for n = number of iterations
  5.  
  6. C:      real 0.85       user 0.78       sys 0.01
  7. Java:   real 1.28       user 0.95       sys 0.26
  8. No JIT: real 3.96       user 3.73       sys 0.21
  9. MCJava: real 3.38       user 0.10       sys 0.11
  10. Python: real 17.67      user 17.39      sys 0.06
  11. Perl:   real 13.55      user 13.29      sys 0.01
  12. ZenVM:  real 3.42       user 3.33       sys 0.00
  13. AceVM:  real 3.42       user 3.32       sys 0.01
  14.  
  15.         As you can see, C is very fast. Java with the JIT switched
  16.         on is also very fast. Java with no JIT is slower than my
  17.         machines, ZenVM (developed for 1999 SE course) and AceVM
  18.         (a Unicode variant which is optimised). The multicomputer
  19.         Java implementation is slower than the local JavaVM, but
  20.         this is due to the time it takes to establish a connection
  21.         to the multicomputer. Python and Perl are slow on plain
  22.         integer operations.
  23.  
  24.  
  25. String Speed Test
  26.         string ops in a loop 10,000 times
  27.         tests string ops and looping speed
  28.         is O(n) for n = number of iterations
  29.  
  30. Java:   real 4.33       user 3.95       sys 0.33
  31. No JIT: real 25.96      user 25.58      sys 0.30
  32. MCJava: real 10.77      user 0.10       sys 0.14
  33. Python: real 2.99       user 2.94       sys 0.05
  34. Perl:   real 2.92       user 2.83       sys 0.01
  35. ZenVM:  real 5.60       user 5.58       sys 0.01
  36. AceVM:  real 2.88       user 2.82       sys 0.00        8-bit chars
  37. AceVM:  real 3.00       user 2.98       sys 0.01        32-bit Unicode chars
  38.  
  39.         The fastest string operations seem to be:
  40.                 AceVM (8-bit version)
  41.                 Perl
  42.                 Python
  43.                 AceVM (32-bit version)
  44.  
  45.         Java is a bit slower again, and then the multicomputer is
  46.         surprisingly slower, and then local Java with no JIT is
  47.         hideously slow. Why? My guess is that it's a combination
  48.         of integers being slower, and therefore string slicing is
  49.         slower, and this compounds the effect.
  50.  
  51.         It's interesting that the 32-bit Unicode version of AceVM
  52.         is almost as fast as Python, despite using strings 4 times
  53.         as long. Admittedly the strings used in this test are not
  54.         very long, so there isn't much of an effect.
  55.  
  56.  
  57. String Building Test
  58.         build a string 4700 chars long, one char at a time
  59.         tests memory copying and looping speed
  60.         is O(n*n) for n = number of iterations due to memory ops
  61.  
  62. Java:   real 1.39       user 1.04       sys 0.30
  63. No JIT: real 1.71       user 1.39       sys 0.32
  64. MCJava: real 2.90       user 0.06       sys 0.14
  65. Python: real 0.22       user 0.17       sys 0.04
  66. Perl:   real 0.29       user 0.25       sys 0.04
  67. AceASM: real 0.03       user 0.00       sys 0.01
  68. ZenVM:  real 0.78       user 0.77       sys 0.01
  69. AceVM:  real 0.15       user 0.13       sys 0.02        8-bit chars
  70. AceVM:  real 0.41       user 0.39       sys 0.02        32-bit Unicode chars
  71.  
  72.         This test builds a string by adding one char to it each
  73.         time through a loop. It's meant to test string allocation
  74.         and memory copying. The fastest results seem to be:
  75.                 AceVM (8-bit version)
  76.                 Python (it hashes the string each time)
  77.                 Perl
  78.                 AceVM (32-bit version)
  79.  
  80.         Java, again, is slower. Interestingly, Java without the JIT
  81.         is a lot faster than the plain String Speed test above.
  82.         Clearly, looping is still efficient even without the JIT,
  83.         but it must be slicing which makes the difference between
  84.         this result and the one above. There is no slicing in this
  85.         test, just string concatenation.
  86.  
  87.         The AceVM Unicode version is half as fast as Python, but
  88.         this is not surprising, since this test really thrashes the
  89.         memory copying of strings, each time a new string is made.
  90.         Still, at only half as fast, it's doing well, given that the
  91.         strings are 4 times the number of bytes. The Unicode version
  92.         also outperforms the ZenVM, an earlier 8-bit virtual machine.

Raw Paste


Login or Register to edit or fork this paste. It's free.