Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Benchmarking your programs

Name: Anonymous 2009-09-05 15:22

How do you do it?
I was thinking of just using time, but I'd have to do everything manually, unless there's some way to get the results of time from a bash script.

Name: Anonymous 2009-09-05 15:27

Write a benchmarker.

Name: Anonymous 2009-09-05 15:34

>>2
don't really feel like reinventing the wheel today

Name: Anonymous 2009-09-05 15:37

>>1
time + sed

Name: Anonymous 2009-09-05 15:38

Name: Anonymous 2009-09-05 15:42

Non-trivial. You cannot compare Java to PHP, then claim PHP is faster with time for some little sort. The constant factor of startup time must be accounted for.

Name: Anonymous 2009-09-05 16:16

Profilers, fuck yeah!

Name: Anonymous 2009-09-05 18:56

I never benchmark, I just buy faster RAM.

Name: Anonymous 2009-09-05 19:02

unsigned t0,t1;
t0=clock();
/*lengthy operation*/
t1=clock();
double t=double(t1-t0)/double(CLOCKS_PER_SEC)*1000.0;

Name: Anonymous 2009-09-05 19:11

Benchmark my anus

Name: Anonymous 2009-09-05 19:25

>>8
What if RAM is not the bottleneck of your program?

Name: Anonymous 2009-09-05 19:38

>>10
:)
I came to this thread to post this, but I see that I was not the only one to think of that. It makes me feel warm and fuzzy inside.

Name: Anonymous 2009-09-05 19:39

>>11
Then you should buy more RAM.

Name: Anonymous 2009-09-06 1:07

in the little benchmarking i have done, i've always used perl.
there's a module, probably called Benchmark or something similar, that seems to do it quite well.

Name: Anonymous 2009-09-06 1:20

>>1
unless there's some way to get the results of time from a bash script.

Wut.

Name: Anonymous 2009-09-06 9:43

>>11
http://downloadmoreram.com/
Don't say I never help you

Name: Anonymous 2009-09-06 9:58

>>16
what the hell?
awesome! thanks

Name: Anonymous 2009-09-06 12:27

>>16

oh wow, /b/ is gonna love this

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-09-06 12:59

Actually if you own a virtual server you can "download more ram" by reallocating the physical ram.



________________________________
http://bayimg.com/image/aadbjaace.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
My Blog: http://frozenvoid.blogspot.com/
«There's nothing in the world so demoralizing as money. »

Name: Anonymous 2009-09-06 13:01

>>19
Hey FV welcome to 1998.

Name: Anonymous 2009-09-06 14:09

>>20
I enjoyed 1998. It was a pretty good year for me.

Name: Anonymous 2009-09-06 15:49

That was the year FV was born.

Name: Anonymous 2009-09-06 16:53

>>22
QFT

Name: Anonymous 2009-09-06 18:21


from time import time
start_time = time()

...

end_time = time()
print end_time - start_time, "seconds"

Name: Anonymous 2009-09-06 18:31

>>24
python -m timeit

Name: Anonymous 2009-09-06 19:21

guys don't use this thread it was obsolete like 2 hours after I made it

Name: Anonymous 2009-09-06 20:45

Prelude> :mod +s

Name: Anonymous 2009-09-06 20:53

>>26
I think you mean 2 hours before you made it.

Name: Anonymous 2009-09-06 21:08


CL-USER> (time (mind-numbingly-complex-top-level-processing-function))
;Evaluation took:
;  2.484 seconds of real time
;  2.484375 seconds of total run time (2.390625 user, 0.093750 ;system)
;  [ Run times consist of 0.171 seconds GC time, and 2.314 ;seconds non-GC time. ]
;  100.00% CPU
;  5,958,909,567 processor cycles
;  217,287,552 bytes consed

(time (fibs 300))
;Evaluation took:
;  0.000 seconds of real time
;  0.000000 seconds of total run time (0.000000 user, 0.000000 system)
;  100.00% CPU
;  547,172 processor cycles
;  28,480 bytes consed

Name: Anonymous 2009-09-06 21:11

I wrote a PHP benchmarking script that will echo the output infinitely. Have fun with it.


function get() {
    $timer = explode( ' ', microtime() );
    $timer = $timer[1] + $timer[0];
    return $timer;
}

$start = get();
do {
    $x = 7;
    $y = 1000;
    if ($x < $y) {
        echo $x + $y;
    }
} while ( $x = 7 );
$end = get();
echo round($end - $start, 4);

Name: Anonymous 2009-09-06 22:32

>>30
Jesus fucking christ.

What a terrible troll.

Fuck.

Don't put spaces between do and {.

Name: Anonymous 2009-09-06 23:22

>>31
Jesus fucking christ.

What a terrible troll.

Fuck.

Don't forget to read your SICP today.

Name: Anonymous 2009-09-07 4:57

>>31
Don't put spaces between do and {.
Excuse me? OIOC has enabled me to shun the {s entirely!

Name: Anonymous 2009-09-07 6:32

>>3
Jesus fucking christ.

What a terrible troll.

Fuck.

Don't respond to blatant trolls.

Name: Anonymous 2009-09-07 10:33

>>3
reinventing the wheel

Laplana?

Name: Anonymous 2009-09-07 10:50

>>28
No, I think that I mean what I thought I mean in >>26
Though “obsolete” might not be the right word

Name: Anonymous 2010-12-06 9:42

Back to /b/, ``GNAA Faggot''

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List