Freemat benchmarks

94 views
Skip to first unread message

louis

unread,
Mar 29, 2010, 5:44:04 AM3/29/10
to freemat-devel
My first post so let me begin with my congratulations on some amazing
work here.

Now for some benchmarks on Matlab 7.1 release 14 and Freemat 4.0
The short story is that these run 4 times faster in Matlab. The good
news is that good optimization helps in both a lot. Zipfile
forthcoming. Results are in the text file freematBenchtest.txt. The
three test files are:

1) function res = vecTest(N,M)
% how to say matrix multiply in matlab

2) function r = funcTest(N)
% different ways of calling a function
% in this case, y = x.^2;
% with x = linspace(-100,100,N);

3) function res = jitTest(N)
% Tests of JIT compliant variants on a for loop

Also two other items:
==================
Strvcat: not my own, seen somewhere and forgotten source.
function out = strvcat(varargin)
%function out = strvcat(varargin)

out = char(varargin{:});
===================

a scott gorlin example of anon function of functions:

% Anon function of functions use
[x y] = meshgrid(linspace(0,1));
dist = 2*pi*sqrt(x.^2 + y.^2);
display = @(wave,freq) imagesc(wave(freq*dist));

figure
display(@sin,2);
figure
display(@cos,2);

works in matlab but not freemat. Thoughts?

Timothy Cyders

unread,
Mar 29, 2010, 8:07:00 AM3/29/10
to freema...@googlegroups.com
Louis,

What operating system are you running? Are you using optimized blas libraries?



--
You received this message because you are subscribed to the Google Groups "freemat-devel" group.
To post to this group, send email to freema...@googlegroups.com.
To unsubscribe from this group, send email to freemat-deve...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/freemat-devel?hl=en.


louis

unread,
Mar 29, 2010, 5:51:18 PM3/29/10
to freemat-devel
Tim,

FreeMat 4.0 windows 32 binary - I didn't build from source, your
mileage may vary.
All code is in the files section of this group, see
freematbenchtest.zip
Here is the top of the freematbenchtest.txt file:

System: XP Pro 5.1 SP3 Dell Dimension 9100 Pentium D 2.80 GHz 2 GB

Applications set to realtime priority
FreeMat 4.0 windows 32
Matlab 7.1 Release 14

Eugene

unread,
Mar 30, 2010, 5:02:02 PM3/30/10
to freemat-devel
Louis,

I think results are mostly as expected - FreeMat jit is still
experimental. We are planning to do many more improvements in the near
future.

One thing. Did you average your benchmark over several runs? The first
time you run a piece of code in FreeMat, jit compiles the code (if it
can), so you get an artifically slow result. The second time and up
you run the code, FreeMat uses "cached" compiled code (until you
change the script). So, you may want to throw away the first benchmark
run.

Cheers,
Eugene

louis

unread,
Mar 31, 2010, 5:24:41 PM3/31/10
to freemat-devel
Hi Eugene very nice work. Yup. I first run the test with N=100 then
again with N=1000000 or so. One eye on the jit window.

The benchmarks are designed to try a host of ways to do the same thing
so they may shed light on where problems lurk.
What impresses me is that it has really small footprint. Personally
3-5 times slower on most things is pretty cool.
Perhaps someone could try out the benchmarks on a Linux machine and
get back.

นายพิจักษ์ เพิ่มประเสริฐ

unread,
Jun 9, 2013, 5:21:31 AM6/9/13
to freema...@googlegroups.com
Hi louis

I can't run on FreeMat on OS X. It has error. 
Error: only scripts can be source-ed, not functions
Can you help me?

เมื่อ วันจันทร์ที่ 29 มีนาคม ค.ศ. 2010, 16 นาฬิกา 44 นาที 04 วินาที UTC+7, louis เขียนว่า:
Reply all
Reply to author
Forward
0 new messages