performance measurements

Each table row shows performance measurements for this Erlang HiPE program with a particular command-line input value N.

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
50,000Timed Out  622   

Read the ↓ make, command line, and program output logs to see how this program was run.

Read regex-dna benchmark to see what this program should do.


Erlang/OTP 18 [erts-7.0] [source] [async-threads:10] [hipe] [kernel-poll:false]

 regex-dna Erlang HiPE program source code

% The Computer Language Benchmarks Game

%%% contributed by Tom Plick
%%% based on Python entry by Dominique Wahli


-compile({inline_size, 10000}).


% readall() reads all data from standard input.

readall() ->
readall(Acc) ->
    In = io:get_chars('', 10000),
    case In of 
        'eof'  ->  lists:append(lists:reverse(Acc)) ;
        _  ->  readall([In | Acc])

exprs() ->

substExprs() ->
    [{"B", "(c|g|t)"}, {"D", "(a|g|t)"},   {"H", "(a|c|t)"}, {"K", "(g|t)"},
     {"M", "(a|c)"},   {"N", "(a|c|g|t)"}, {"R", "(a|g)"},   {"S", "(c|g)"},
     {"V", "(a|c|g)"}, {"W", "(a|t)"},     {"Y", "(c|t)"}].

numberOfMatches(String, Regex) ->
    {match, Matches} = regexp:matches(String, Regex),

printNumberOfMatches(String, Regex) ->
    N = numberOfMatches(String, Regex),
    io:format("~s ~w~n", [Regex, N]).

% subst(String, ListOfRegexes) returns String after each substitution in 
%     ListOfRegexes is performed

subst(String, []) ->
subst(String, [{Exp, Replacement} | Tail]) ->
    {ok, String2, _} = regexp:gsub(String, Exp, Replacement),
    subst(String2, Tail).

main(_Arg) ->
    Sequence1 = readall(),

    {ok, Sequence2, _} = regexp:gsub(Sequence1, "(>[^\n]*\n)|\n|\r", ""),
    lists:foreach(fun(Regex) -> printNumberOfMatches(Sequence2, Regex) end, exprs()),

    Sequence3 = subst(Sequence2, substExprs()),
    io:format("~n~w~n~w~n~w~n", [length(Sequence1), length(Sequence2), length(Sequence3)]),

 make, command-line, and program output logs

Sat, 18 Jul 2015 19:52:20 GMT

mv regexdna.hipe regexdna.erl
/usr/local/src/otp_src_18.0_nosmp/bin/erlc +native +"{hipe, [o3]}"  regexdna.erl
regexdna.erl:47: Warning: regexp:matches/2: removed in R15; use the re module instead
regexdna.erl:61: Warning: regexp:gsub/3: removed in R15; use the re module instead
regexdna.erl:69: Warning: regexp:gsub/3: removed in R15; use the re module instead
rm regexdna.erl
0.59s to complete and log all make actions

/usr/local/src/otp_src_18.0_nosmp/bin/erl -smp disable -noshell -run -noinput -run regexdna main 0 < regexdna-input50000.txt

TIMED OUT after 900s


Revised BSD license

  Home   Conclusions   License   Play