Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (15 sloc) 435 Bytes
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: heaps math sequences kernel ;
IN: benchmark.heaps
: data ( -- seq )
1 6000 [ 13 + 79 * 13591 mod dup ] replicate nip ;
: heap-test ( -- )
<min-heap>
data
[ [ dup pick heap-push ] each ]
[ length [ dup heap-pop* ] times ] bi
drop ;
: heaps-benchmark ( -- )
100 [ heap-test ] times ;
MAIN: heaps-benchmark