-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsample.json
More file actions
1 lines (1 loc) · 6.23 KB
/
sample.json
File metadata and controls
1 lines (1 loc) · 6.23 KB
1
{"projects":[{"id":"benchcode-904","title":"Factorial Sample","author":"Ying Li <ying@concurix.com>","code":"-module(fact).\n-compile(export_all).\n\nf(0) -> 1;\nf(N) -> N * f(N-1).\n\nstart() -> f(1997).\n","submission_date":"November 06, 2012 18:23:54","cx_user_id":"cx_user-268"},{"id":"benchcode-905","title":"Mandelbrot with IO","author":"Shootout site","code":"%% The Computer Language Benchmarks Game\n%% http://shootout.alioth.debian.org/\n%% Contributed by Fredrik Svahn based on Per Gustafsson's mandelbrot program\n\n-module(mandelbrot).\n-export([start/0, main/1]).\n-define(LIM_SQR, 4.0).\n-define(ITER, 50).\n-define(SR, -1.5).\n-define(SI, -1).\n\nstart() -> main(256).\n\nmain(N) ->\n case file:open(\"/tmp/output.ppm\", [write]) of\n {ok, F} ->\n Start = now(),\n io:put_chars(F, [\"P4\\n\", integer_to_list(N), \" \", integer_to_list(N), \"\\n\"]),\n \n %% Spawn one process per row\n Row = fun(Y)-> spawn(fun()-> row(F, 0, ?SI+Y*2/N, N, 0, [], 7) end) end,\n Pids = lists:map(Row, lists:seq(0,N-1)),\n\n %%Pass token around to make sure printouts are in the right order\n hd(Pids) ! tl(Pids) ++ [ self() ],\n receive _Token -> file:close(F) end,\n Stop = now(),\n Time = timer:now_diff(Stop, Start),\n %%io:format(\"Elapsed time (micros): ~p\\n\", [Time]),\n Time;\n {error, Reason} ->\n io:format(\"Couldn't open output.png: ~p\\n\", [Reason]),\n 0\n end.\n\n%Iterate over a row, collect bits, bytes and finally print the row\nrow(F, X, _, N, Bits, Bytes, BitC) when X =:= N-1 ->\n receive Pids ->\n\t put_chars(F, Bits, Bytes, BitC),\n\t hd(Pids) ! tl(Pids)\n end;\n\nrow(F, X, Y2, N, Bits, Bytes, 0) ->\n row(F, X+1, Y2, N, 0, [Bits bsl 1 + m(?ITER, ?SR+X*2/N, Y2) | Bytes], 7);\n\nrow(F, X, Y2, N, Bits, Bytes, BitC) ->\n row(F, X+1, Y2, N, Bits bsl 1 + m(?ITER, ?SR+X*2/N, Y2), Bytes, BitC-1).\n\n%Mandelbrot algorithm\nm(Iter, CR,CI) -> m(Iter - 1, CR, CI, CR, CI).\n\nm(Iter, R, I, CR, CI) ->\n case R*R+I*I > ?LIM_SQR of \n\tfalse when Iter > 0 -> m(Iter-1, R*R-I*I+CR, 2*R*I+CI, CR, CI);\n\tfalse -> 1;\n\ttrue -> 0\n end.\n\nput_chars(F, _, Bytes, 7)-> io:put_chars(F, lists:reverse(Bytes));\nput_chars(F, Bits, Bytes, C) -> io:put_chars(F, lists:reverse([Bits bsl (C+1) | Bytes])).\n","submission_date":"November 06, 2012 18:23:54","cx_user_id":"cx_user-268"},{"id":"benchcode-906","title":"Mandelbrot Pure","author":"Shootout site","code":"%% The Computer Language Benchmarks Game\n%% http://shootout.alioth.debian.org/\n%% Contributed by Fredrik Svahn based on Per Gustafsson's mandelbrot program\n\n-module(mandelbrot_no_io).\n-export([start/0, main/1, row/6]).\n-define(LIM_SQR, 4.0).\n-define(ITER, 50).\n-define(SR, -1.5).\n-define(SI, -1).\n\nstart() -> main(256).\n\nmain(N) ->\n\t%% Spawn one process per row\n\tRow = fun(Y)-> spawn(mandelbrot_no_io, row, [ 0, ?SI+Y*2/N, N, 0, [], 7]) end,\n\tPids = lists:map(Row, lists:seq(0,N-1)),\n\n\t%%Pass token around to make sure printouts are in the right order\n\thd(Pids) ! tl(Pids) ++ [ self() ],\n\treceive _Token -> ok end.\n\t\t\t\n\n%Iterate over a row, collect bits, bytes and finally print the row\nrow(X, _, N, Bits, Bytes, BitC) when X =:= N-1 ->\n receive Pids ->\n\t hd(Pids) ! tl(Pids)\n end;\n\nrow( X, Y2, N, Bits, Bytes, 0) ->\n row( X+1, Y2, N, 0, [Bits bsl 1 + m(?ITER, ?SR+X*2/N, Y2) | Bytes], 7);\n\nrow( X, Y2, N, Bits, Bytes, BitC) ->\n row( X+1, Y2, N, Bits bsl 1 + m(?ITER, ?SR+X*2/N, Y2), Bytes, BitC-1).\n\n%Mandelbrot algorithm\nm(Iter, CR,CI) -> m(Iter - 1, CR, CI, CR, CI).\n\nm(Iter, R, I, CR, CI) ->\n case R*R+I*I > ?LIM_SQR of \n\tfalse when Iter > 0 -> m(Iter-1, R*R-I*I+CR, 2*R*I+CI, CR, CI);\n\tfalse -> 1;\n\ttrue -> 0\n end.\n","submission_date":"November 06, 2012 18:23:54","cx_user_id":"cx_user-268"},{"id":"benchcode-907","title":"Malware Sample","author":"Ian Seyler <ian@concurix.com>","code":"-module(malware).\n-export([start/0]).\n\nstart() ->\n\tio:fwrite(\"This is a potentially malicious program!\\n\"),\n\tos:cmd(\"ls -la > test.txt\").\n","submission_date":"November 06, 2012 18:23:54","cx_user_id":"cx_user-268"}],"runs":[{"id":"id","update_time":"November 06, 2012 18:24:07","benchcode_id":"benchcode-id"}],"analysis":{"purity":10,"errors":"ok","mem_size":200,"load_factor":100,"instructions":0,"instruction_time":1,"cache_access":0,"cache_miss":0,"branch_taken":0,"branch_miss":0},"speed_test":[{"id":"machine1","machine":"Test Machine","time":65}],"memo_stats":[{"functionname":"mandelbrotSeq3:mloop3/3","sample_size":400,"minimum":0,"maximum":6,"median":0.0,"arithmetic_mean":0.285,"standard_deviation":0.6072684743999154,"skewness":0.8615482500000013,"kurtosis":3.811514998124996},{"functionname":"mandelbrotSeq3:bit/3","sample_size":400,"minimum":0,"maximum":7,"median":1.0,"arithmetic_mean":1.6725,"standard_deviation":1.0748226597909067,"skewness":2.732653406250031,"kurtosis":12.487329384257714},{"functionname":"mandelbrotSeq3:row/4","sample_size":421,"minimum":0,"maximum":9,"median":1,"arithmetic_mean":1.5843230403800475,"standard_deviation":1.1658812862185626,"skewness":2.220568526600964,"kurtosis":15.44312763142636},{"functionname":"mandelbrotSeq3:mloop5/5","sample_size":9968,"minimum":0,"maximum":61,"median":2.0,"arithmetic_mean":2.3544341894060996,"standard_deviation":1.5727025336384761,"skewness":46.69599485198084,"kurtosis":2192.62064178613},{"functionname":"mandelbrotSeq3:mandel1/1","sample_size":1,"minimum":1,"maximum":1,"median":1,"arithmetic_mean":1.0,"standard_deviation":0.0,"skewness":0.0,"kurtosis":0.0}],"load_test":[{"id":"benchmachine-690","label":"Development iMac","legendEntry":true,"data":{"x":[1],"y":[1]}},{"id":"benchmachine-691","label":"Amazon Linux 8 Core","legendEntry":true,"data":{"x":[1],"y":[1]}},{"id":"benchmachine-692","label":"Concurix OS 64 Core","legendEntry":true,"data":{"x":[1],"y":[1]}}],"status":[{"id":"benchmachine-689","label":"Development iMac","status":"running","process_count":0},{"id":"benchmachine-690","label":"Development iMac","status":"running","process_count":0},{"id":"benchmachine-691","label":"Amazon Linux 8 Core","status":"running","process_count":0},{"id":"benchmachine-692","label":"Concurix OS 64 Core","status":"running","process_count":0}]}