regenerate some data sets (except automerge), putting the contents in modules

This commit is contained in:
2024-05-25 13:51:02 +01:00
parent b96539d348
commit e9339908ef
9 changed files with 179678 additions and 178219 deletions

9
.gitignore vendored
View File

@@ -8,11 +8,4 @@
/examples.du /examples.du
/examples.ud /examples.ud
/svelte.txt /out
/svelte23.txt
/rust.txt
/rust23.txt
/seph.txt
/seph23.txt
/automerge.txt
/automerge23.txt

File diff suppressed because one or more lines are too long

Binary file not shown.

81254
rust.sml

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

276549
seph.sml

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

View File

@@ -27,33 +27,36 @@ fun runTxnsTime arr =
end end
fun compareTxns arr = fun compareTxns arr =
Vector.foldli (fn (idx, (pos, delNum, insStr), (rope, gapBuffer)) => Vector.foldli
let (fn (idx, (pos, delNum, insStr), (rope, gapBuffer)) =>
val strSize = String.size insStr let
val strSize = String.size insStr
val rope = if strSize > 0 then TinyRope.insert (pos, insStr, rope) else val rope =
rope if strSize > 0 then TinyRope.insert (pos, insStr, rope) else rope
val gapBuffer = if strSize > 0 then GapBuffer.insert (pos, insStr, val gapBuffer =
gapBuffer) else gapBuffer if strSize > 0 then GapBuffer.insert (pos, insStr, gapBuffer)
else gapBuffer
val ropeString = TinyRope.toString rope val ropeString = TinyRope.toString rope
val gapBufferString = GapBuffer.toString gapBuffer val gapBufferString = GapBuffer.toString gapBuffer
in in
if ropeString = gapBufferString then if ropeString = gapBufferString then
(rope, gapBuffer) (rope, gapBuffer)
else else
let let
val _ = print ("difference detected at txn number: " ^ (Int.toString idx) ^ "\n") val _ = print
val _ = print "rope string: \n" ("difference detected at txn number: " ^ (Int.toString idx)
val _ = print (ropeString ^ "\n") ^ "\n")
val _ = print "gap string: \n" val _ = print "rope string: \n"
val _ = print (gapBufferString ^ "\n") val _ = print (ropeString ^ "\n")
val _ = raise Empty val _ = print "gap string: \n"
in val _ = print (gapBufferString ^ "\n")
(rope, gapBuffer) val _ = raise Empty
end in
end (rope, gapBuffer)
) (TinyRope.empty, GapBuffer.empty) arr end
end) (TinyRope.empty, GapBuffer.empty) arr
fun runToString rope = GapBuffer.toString rope fun runToString rope = GapBuffer.toString rope
@@ -77,26 +80,21 @@ fun write (fileName, rope) =
() ()
end end
fun loop () = loop() fun loop () = loop ()
fun main () = fun main () =
let let
(* Timing benchmarks. *) (* Timing benchmarks. *)
val _ = runTxnsTime SvelteComponent.txns val svelte = runTxnsTime SvelteComponent.txns
val _ = runTxnsTime rust_arr val rust = runTxnsTime RustCode.txns
val _ = runTxnsTime seph_arr val seph = runTxnsTime SephBlog.txns
val _ = runTxnsTime automerge_arr val automerge = runTxnsTime automerge_arr
(* Tests for correctness; will fail if incorrect. *) (* Tests for correctness; will fail if incorrect. *)
val svelte = runTxns SvelteComponent.txns (** Tests for insertion correctness (compare against rope). **)
val rust = runTxns rust_arr
val seph = runTxns seph_arr
val automerge = runTxns automerge_arr
(* Tests for insertion correctness (compare against rope). *)
val _ = compareTxns SvelteComponent.txns val _ = compareTxns SvelteComponent.txns
val _ = compareTxns rust_arr val _ = compareTxns RustCode.txns
val _ = compareTxns seph_arr val _ = compareTxns SephBlog.txns
val _ = compareTxns automerge_arr val _ = compareTxns automerge_arr
(* Tests for line metadata. *) (* Tests for line metadata. *)
@@ -107,10 +105,10 @@ fun main () =
val _ = Rope.verifyLines automerge val _ = Rope.verifyLines automerge
*) *)
val _ = write ("svelte_gap.txt", svelte) val _ = write ("out/svelte_gap.txt", svelte)
val _ = write ("rust23_gap.txt", rust) val _ = write ("out/rust23_gap.txt", rust)
val _ = write ("seph23_gap.txt", seph) val _ = write ("out/seph23_gap.txt", seph)
val _ = write ("automerge_gap.txt", automerge) val _ = write ("out/automerge_gap.txt", automerge)
in in
loop () loop ()
end end