Skip to content

head not O(1) #76

Closed
Closed
@jacereda

Description

@jacereda

Looks like head isn't O(1), at least on node v4.4.7.

I measured with purescript-benchotron as follows:

benchHead :: Benchmark
benchHead = mkBenchmark
  { slug: "head"
  , title: "Head of a structure"
  , sizes: (1 .. 8) <#> (_ * 150)
  , sizeInterpretation: "Number of elements in the structure"
  , inputsPerSize: 1
  , gen: randomArray
  , functions: [ benchFn "Array" A.head
               , benchFn "Array'" (_ `A.index` 0)
               ]
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions