Pharo System Settings

I am new to StackOverflow and looking for tips and help setting up Pharo 5.0 on Windows.

My computer is running Windows 10, a 4 GHz CPU I5-4670K and a Plextor 512G SSD as drive C, on which Pharo 5.0 is loaded and running.

Below is a set of codes that I used to understand the behavior of Pharo in terms of both performance and accuracy.

  | x y |
  x := 0.
  y := 400000000.
  [1 to: 2000000000 do: [ :i | 
      x := x + 0.2]] timeToRun

It took 2 minutes 8.281 seconds to complete. If I knock one zero out of iterations, it only needs 1,762 seconds. 10 times more iterations used over 70 times at runtime. It seems that I got to the system boundary, so the execution time has increased much more than 10 times between the two cases.

Evaluate all the tips and help fine-tune the Pharo 5.0 VM so that I can reduce such unexpected and unwanted system behavior?

ps At run time, Windows Task Manager did not report any changes to disk performance. To a large extent, execution is operations with RAM and CPU. By the way, if you do not have a much faster PC, do not try to add another zero to the number of iterations, it took so much time that I had to break the execution.

+4
source share
1 answer

Welcome to SO (and to the smalltalk tag!)

First, note that the temporary yone does not play any role here, so we can simplify the fragment a bit

| x |
x := 0.
[1 to: 200000000 * 10 do: [ :i | 
  x := x + 0.2]] timeToRun

which you compared with

| x |
x := 0.
[1 to: 200000000 * 1 do: [ :i | 
  x := x + 0.2]] timeToRun

, 10 , , i SmallInteger LargeInteger. , , i, i SmallInteger, i := i + 1, , LargeInteger , , SmallInteger.

LargeInteger? , , SmallInteger maxVal 200000000 * 10:

(200000000 * 10) - SmallInteger maxVal  = 926,258,177

, Pharo i.

,

| x |
x := 0.
[
  10 timesRepeat: [1 to: 200000000 * 1 do: [ :i | x := x + 0.2]]
] timeToRun

10 .


, , , LargeInteger Pharo. , .

Pharo , API Integer. , VM LargeInteger, () , .

+5

Source: https://habr.com/ru/post/1668564/


All Articles