[erlang-questions] OTP-18 os:timestamp 10 times slower on OSX compared to OTP-17

Pavel Martynenko pavelmart@REDACTED
Tue Jul 7 11:52:16 CEST 2015


Poor performance of os:timestamp and erlang:now on OSX compared to OTP-17.

Here is the comparison of 1M cycles.

On OSX Darwin Kernel Version 14.3.0 (hardware)

Eshell V6.4  (abort with ^G)
1>
erlang:now/0                 232390
os:timestamp/0               116950

Eshell V7.0  (abort with ^G)
1>
erlang:now/0                1416680
erlang:timestamp/0          1151160
erlang:monotonic_time/0     1129957
erlang:system_time/0        1137389
erlang:time_offset/0          50977
erlang:unique_integer/0       52861
t:-test/0-fun-0-/0          1214256
os:timestamp/0              1003910
os:system_time/0            1008520

And Linux 3.16.0-41-generic (virtualised on the same hardware as OSX)

Eshell V6.4.1  (abort with ^G)
1>
erlang:now/0                2400925
os:timestamp/0              2223445

Eshell V7.0  (abort with ^G)
1>
erlang:now/0                2919313
erlang:timestamp/0          2654415
erlang:monotonic_time/0     2412814
erlang:system_time/0        2478186
erlang:time_offset/0          43202
erlang:unique_integer/0       34817
t:-test/0-fun-0-/0          2594927
os:timestamp/0              2065593
os:system_time/0            2007291

Where
t:-test/0-fun-0-/0
is
fun () -> {erlang:monotonic_time(), erlang:unique_integer([monotonic])} end.

-- 
Cheers,
Pavlo Martynenko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150707/1bbb4f0a/attachment.htm>


More information about the erlang-questions mailing list