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

BIN
.DS_Store vendored Normal file

Binary file not shown.

5
LICENSE Normal file
View File

@@ -0,0 +1,5 @@
Copyright (C) 2023 by Humza Shahid <humzasaur@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# Brolib-sml
Standard ML port of [this](https://github.com/hummy123/brolib) rope implementation.

View File

@@ -1,8 +0,0 @@
All files except rope.sml (written by me) were genereated from the repository below.
https://github.com/josephg/editing-traces/tree/master/sequential_traces
The files in that repository are all licensed under CC BY 4.0, except for the Automerge edit trace which was taken from the below repository, where I do not see a license.
https://github.com/automerge/automerge-perf/
rope.sml is licensed under the Zero Clause BSD license described at the link below.
https://landley.net/toybox/license.html

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