This commit is contained in:
Humza Shahid
2023-11-14 10:44:52 +00:00
parent 374f89348e
commit f0fc084171
5 changed files with 48 additions and 18 deletions

View File

@@ -50,17 +50,47 @@ fun run_to_string_time title rope =
time_func title f
end
val _ =
let
val svelte = run_txns_time "svelte" svelte_arr
val rust = run_txns_time "rust" rust_arr
val seph = run_txns_time "seph" seph_arr
val automerge = run_txns_time "automerge" automerge_arr
fun run_txns_1000_times counter arr acc =
if counter = 1000 then
acc
else
let
val start_time = Time.now()
val start_time = Time.toMilliseconds start_time
val _ = run_to_string_time "svelte to_string" svelte
val _ = run_to_string_time "rust to_string" rust
val _ = run_to_string_time "seph to_string" seph
val _ = run_to_string_time "automerge to_string" automerge
val _ = run_txns arr
val end_time = Time.now()
val end_time = Time.toMilliseconds end_time
val time_diff = end_time - start_time
val time_diff = LargeInt.toString time_diff
in
run_txns_1000_times (counter + 1) arr (time_diff::acc)
end
fun write_file filename acc =
let
val str = String.concatWith "," acc
val fd = TextIO.openOut filename
val _ = TextIO.output (fd, str) handle e => (TextIO.closeOut fd; raise e)
val _ = TextIO.closeOut fd
in
()
end
val _ =
let
val svelte = run_txns_1000_times 0 svelte_arr []
val _ = write_file "svelte_edit_traces.csv" svelte
val rust = run_txns_1000_times 0 rust_arr []
val _ = write_file "rust_edit_traces.csv" rust
val seph = run_txns_1000_times 0 seph_arr []
val _ = write_file "seph_edit_traces.csv" seph
val automerge = run_txns_1000_times 0 automerge_arr []
val _ = write_file "automerge_edit_traces.csv" automerge
in
()
end