s/benchmarks/stx/BenchmarkLinkedList.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 12 Feb 2020 15:09:57 +0000
changeset 318 1b735d3747d8
parent 308 a09175ff8e80
permissions -rw-r--r--
Use launcher script to run smalltalk ...rather than binary. This makes it work in both, in-tree builds and (new) out-of-tree builds.

"{ Package: 'jv:calipel/s/benchmarks/stx' }"

"{ NameSpace: Smalltalk }"

Object subclass:#BenchmarkLinkedList
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'CalipeL-S-Benchmarks-St/X'
!

!BenchmarkLinkedList class methodsFor:'benchmarking'!

buildList
    "build a linked list with 1000 elements ..."

    |anchor link|

    anchor := nil.
    1 to:1000 do:[:i |
        link := ValueLink basicNew value:i.
        link nextLink:anchor.
        anchor := link.
    ]

    "
     5 timesRepeat:[
         Transcript showCR:(
             Time millisecondsToRun:[
                1000 timesRepeat:[LinkedListBenchmark buildList]
             ]
         )
     ]
    "

    "Created: 13.5.1997 / 18:39:54 / cg"
    "Modified: 13.5.1997 / 18:46:55 / cg"
! !