add insert benchmark comparing StringSet to BroTree (StringSet is just a few ms faster for this)

This commit is contained in:
2024-09-09 14:54:25 +01:00
parent 4a16daaa1a
commit 7d707c9af4
9 changed files with 116300 additions and 0 deletions

33
bench/conv-words.sml Normal file
View File

@@ -0,0 +1,33 @@
val inIo = TextIO.openIn "words.txt"
val outIO = TextIO.openOut "words.sml"
fun readLines (inIo, acc) =
case TextIO.inputLine inIo of
SOME word => readLines (inIo, word :: acc)
| NONE => List.rev acc
fun writeLines (outIO, lst) =
case lst of
[] => ()
| word :: tl =>
let
val word = String.substring (word, 0, String.size word - 2)
val isLast = tl = []
val word =
if isLast then "\"" ^ word ^ "\""
else "\"" ^ word ^ "\",\n"
val _ = TextIO.output (outIO, word)
in
writeLines (outIO, tl)
end
fun main () =
let
val lst = readLines (inIo, [])
val _ = TextIO.output
(outIO, "structure WordsList = \nstruct \n val words = #[\n")
val _ = writeLines (outIO, lst)
val _ = TextIO.output (outIO, "]\n end")
in
()
end