A program to measure flops in Perl (should it be this "off"?)



I am in a grad level computer architecture class. Although it does not
have any programming prereqs most of the students are CS (I am EE), so
the first assignment was to write a little program to determine the
amount of flops per second your computer runs at. It is suppose to be a
short program, and apart from making sure you use a good timer and run
for long enough to ensure accuracy it doesn't have to include any
really big optimizations (i.e. making sure all the data fits in cache
to minimize memory transfer, doing something like LINPACK and making
sure your # ops >> # data, etc etc).

My personal caveat is that I suck at C/C++, I wouldn't even know where
to start. However, I have coded in Perl at many internships and other
projects so I wanted to use Perl. Well, I am getting downright horrible
performance from my Perl script (I would say a factor of 100 or more
slower than my CPU should be). I have pretty much the same sort of
algorithm as a friend of mine has in C++ and he is getting something
like ~500Mflops on is laptop while my perl script (running perl for
windows, I know, I know) says 2-5Mflop! Now I know Perl is interpretted
but should it be THAT slow? If so, why? If not, so I am just coding
something oddly?

-Josh

.



Relevant Pages

  • Re: create the home directories of 424 students in a server machine
    ... I am a new bie in perl. ... I have to create the home directories of 424 students in a server machine. ... If this is a legitimate question and not a student asking us to write his homework for him, I would not use simple perl script to create user accounts. ...
    (perl.beginners)
  • RE: Segmentation Fault(Core dumped)
    ... But when I started testing my perl script, ... Compilation failed in require at ./test.pl line 13. ... > official business of Sender. ...
    (perl.dbi.users)
  • Re: sharing variables-data perl-asp
    ... Also how do you invoke a perl script from an active server page? ... ASP in Perl. ... Why do you want to shell out to perl when you're already running perl? ...
    (comp.lang.perl.misc)
  • Re: environment variables in perl scripts
    ... Define a BEGIN block in your perl program. ... > perl script, something like: ... > environment variables are there and diag.txt shows ... > This communication is intended for the use of the ...
    (perl.dbi.users)
  • Re: kill process when file count reached,,.
    ... an infinite loop there, ... IMO you could just use readdir and grep in perl. ... You're using awk in backticks in a perl script? ... Perl has a kill builtin, why the hell not use that. ...
    (comp.lang.perl.modules)