Skip to content

Instantly share code, notes, and snippets.

@platinumthinker
Last active June 6, 2017 15:25
Show Gist options
  • Select an option

  • Save platinumthinker/905c08778f1c6766098ac7bb26abef54 to your computer and use it in GitHub Desktop.

Select an option

Save platinumthinker/905c08778f1c6766098ac7bb26abef54 to your computer and use it in GitHub Desktop.
id CPU Family CPU (cpu x core x thread) RAM Res shell Res
elbrus Elbrus 4C 1891ВМ8Я 800 MHz 4x4x1 DDR3 1600 12910 28710
boris Yorkfield Core 2 Quad Q8300 2.5GHz 1x4x1 DDR3 1333 105420 221796
alpha Ivy Bridge i5-3570K 3.40GHz 1x4x1 DDR3 1600 (2 channels) 172413 410515
anton Sandy Bridge E i7-3820 3.60GHz 1x4x2 DDR3 1600 (4 сhannels) 185185 459399
thinker Haswell i5-4590 3.30GHz 1x4x1 DDR3 1600 (2 channels) 357143 653885
ibm Haswell i3-4160 3.60GHz 1x2x2 ???? 357142
rabbit Kaby Lake i3-7100 3.90GHz 1x2x2 DDR4 2133 (2 channels) 476190 830651
-module(ping_pong_gen_server).
-behaviour(gen_server).
%% API
-export([
start_link/0,
ping/2,
test/0
]).
%% gen_server callbacks
-export([init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]).
-define(SERVER, ?MODULE).
-record(state, {}).
start_link() ->
gen_server:start_link(?MODULE, [], []).
ping(Ref, Id) ->
gen_server:call(Ref, {ping, Id}).
test() ->
{ok, Ref1} = ping_pong_gen_server:start_link(),
L = lists:seq(1, 10000000),
{T, ok} = timer:tc(fun() -> lists:foreach(fun(Id) -> ping_pong_gen_server:ping(Ref1, Id) end, L) end),
10000000 / ( T / 1000000).
init([]) ->
{ok, #state{}}.
handle_call({ping, Id}, _From, State) ->
Reply = {pong, Id},
{reply, Reply, State};
handle_call(_Request, _From, State) ->
Reply = ok,
{reply, Reply, State}.
handle_cast(_Msg, State) ->
{noreply, State}.
handle_info(_Info, State) ->
{noreply, State}.
terminate(_Reason, _State) ->
ok.
code_change(_OldVsn, State, _Extra) ->
{ok, State}.
echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
{ok, Ref1} = ping_pong_gen_server:start_link(),
L = lists:seq(1, 10000000),
{T, ok} = timer:tc(fun() -> lists:foreach(fun(Id) -> ping_pong_gen_server:ping(Ref1, Id) end, L) end),
10000000 / ( T / 1000000).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment