anchor.diff:          printfn "max %d ms" (Array.max arr)
           printfn "sum %d ms" (Array.sum arr)
           result
  +
  +    let testSparseIndex() = 
  +        let r = new Random(1)
  +        
  +        let innerlen = 10000
  +        let indices = [1..innerlen] |> List.map (fun i -> (int64 (r.Next(0, 2160*1080)) ))
  +        let map = SparseReadWrite.readBitMap @"D:\temp\bathy_10m.sbm"
  +        let sw = Diagnostics.Stopwatch.StartNew()
  +        let result = indices |> Seq.map (BitMap.sparseIndex id map) |> Array.ofSeq
  +        sw.Stop()
  +        printfn "test sparse index %d ms" sw.ElapsedMilliseconds
  +        result
  +
       let testSimpleRandom = testRandomQuery AsciiProvider.convertToSimple Reader.simpleQuery
       let testSparseRandom = testRandomQuery AsciiProvider.convertToSparse Reader.sparseQuery 
       let testSmallMarspec() =
  
positive.code: 
  module BitMap =
  
      type bitmap = System.Collections.BitArray
      
      let fromArray (bools:bool []) = new System.Collections.BitArray(bools)
      let init n (f:int->bool) = 
          let bools = Array.init n f
          fromArray bools
  
      let isSet index (b:bitmap) =
          b.Get(int index)
  
      let countUpto (uptoIndex:int64) (b:bitmap) = 
          let mutable count = 0L
          for i=0 to (int uptoIndex)-1 do
              if b.Get(i) then
                  count <- count+1L
          count
  
  
negative.code:     
  module Reader =
      let simpleQuery indices fileName =
          SimpleReadWrite.readValues fileName indices
          //MemoryMappedSimpleRead.readValues fileName indices
  
      let sparseQuery indices fileName =
          SparseReadWrite.readValues fileName indices
  