Is 8GB RAM faster on 64bit or on 32bit processor?
A friend asked me if 8 gigabytes of ram is much slower on 32bit than on 64bit linux. The standard 32 bit can handle at most 4GB of ram. To access more ram you have to enable the CONFIG_HIGHMEM64G option in kernel. The question is if this feature make access to memory much slower.
I created basic test to measure ram speed. The program sequentially writes to rather big memory chunk. After first benchmark, as a single process, the program forks to check if the memory access would be much slower for more concurrent processes. The goal is also to make use of more than 4GBytes of memory, so that we know that HIGHMEM is used.
The results showed that, uh, the memory access is as fast on 64 bits as on 32 bits for big memory usage.
My test program is here.
Some of the tests:
1. 4 processes, every uses 1500MB memory
32-bit-machine$ ./test-mem 4 10 1500
For single process:
In 10680.104ms done 13 tests. It means 478.629 mln (read int)/sec
For 4 processes:
In 34514.712ms done 13 tests. It means 148.105 mln (read int)/sec
In 34584.651ms done 13 tests. It means 147.806 mln (read int)/sec
In 34607.142ms done 13 tests. It means 147.710 mln (read int)/sec
In 34653.662ms done 13 tests. It means 147.511 mln (read int)/sec
64-bit-machine$ ./test-mem 4 10 1500
For single process:
In 10817.252ms done 13 tests. It means 472.561 mln (read int)/sec
For 4 processes:
In 35059.194ms done 13 tests. It means 145.805 mln (read int)/sec
In 35102.285ms done 13 tests. It means 145.626 mln (read int)/sec
In 35102.671ms done 13 tests. It means 145.624 mln (read int)/sec
In 35175.010ms done 13 tests. It means 145.325 mln (read int)/sec
2. 10 processes, every one uses 512MB of memory (this is more like context-switching test)
32-bit-machine$ ./test-mem 10 10 512
For single process:
In 10251.710ms done 37 tests. It means 484.412 mln (read int)/sec
For 10 processes:
In 82147.174ms done 37 tests. It means 60.453 mln (read int)/sec
In 82751.646ms done 37 tests. It means 60.012 mln (read int)/sec
In 83004.705ms done 37 tests. It means 59.829 mln (read int)/sec
In 82591.951ms done 37 tests. It means 60.128 mln (read int)/sec
In 82678.590ms done 37 tests. It means 60.065 mln (read int)/sec
In 82652.342ms done 37 tests. It means 60.084 mln (read int)/sec
In 82636.134ms done 37 tests. It means 60.095 mln (read int)/sec
In 82535.299ms done 37 tests. It means 60.169 mln (read int)/sec
In 82535.830ms done 37 tests. It means 60.168 mln (read int)/sec
In 82784.449ms done 37 tests. It means 59.988 mln (read int)/sec
64-bit-machine$ ./test-mem 10 10 512
For single process:
In 10273.896ms done 37 tests. It means 483.366 mln (read int)/sec
For 10 processes:
In 82660.408ms done 37 tests. It means 60.078 mln (read int)/sec
In 82557.546ms done 37 tests. It means 60.153 mln (read int)/sec
In 83497.783ms done 37 tests. It means 59.475 mln (read int)/sec
In 82660.669ms done 37 tests. It means 60.078 mln (read int)/sec
In 82708.567ms done 37 tests. It means 60.043 mln (read int)/sec
In 83360.999ms done 37 tests. It means 59.573 mln (read int)/sec
In 83044.817ms done 37 tests. It means 59.800 mln (read int)/sec
In 83117.576ms done 37 tests. It means 59.747 mln (read int)/sec
In 83245.083ms done 37 tests. It means 59.656 mln (read int)/sec
In 83203.710ms done 37 tests. It means 59.686 mln (read int)/sec
3. 3 processes, every one uses 2048MB of ram
32-bit-machine$ ./test-mem 3 10 2048
For single process:
In 10258.171ms done 9 tests. It means 471.023 mln (read int)/sec
For 3 processes:
In 20643.669ms done 9 tests. It means 234.059 mln (read int)/sec
In 21914.211ms done 9 tests. It means 220.489 mln (read int)/sec
In 24316.862ms done 9 tests. It means 198.703 mln (read int)/sec
64-bit-machine$ ./test-mem 3 10 2048
For single process:
In 10213.609ms done 9 tests. It means 473.078 mln (read int)/sec
For 3 processes:
In 20694.933ms done 9 tests. It means 233.479 mln (read int)/sec
In 23680.936ms done 9 tests. It means 204.039 mln (read int)/sec
In 24266.013ms done 9 tests. It means 199.120 mln (read int)/sec
No comments:
Post a Comment