From f0fc084171886a1d30e4bdaccf6d575a6d22a849 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Tue, 14 Nov 2023 10:44:52 +0000 Subject: [PATCH] license --- .DS_Store | Bin 0 -> 6148 bytes LICENSE | 5 +++++ README.md | 3 +++ third-party | 8 -------- utils.sml | 50 ++++++++++++++++++++++++++++++++++++++++---------- 5 files changed, 48 insertions(+), 18 deletions(-) create mode 100644 .DS_Store create mode 100644 LICENSE create mode 100644 README.md delete mode 100644 third-party diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6308708d133b54f75f97bbd24c133a93ffed3a48 GIT binary patch literal 6148 zcmeHKOHRWu6dXe&LJeZ3!1-9gJln18 zv_W)(5b~4!CUNHZ+2c5l0jNgaI{|h9#4LhQjc$p_b14h9W^49{O4>NjhTTp!?C@S1 z3>Fj!3jA#aWbH<%V}J)tOY8TP%X;Tin;t}M#v^xtXACh$-;YrrWWG5u+qgrHDY;MR zlRu!ZW5T=4j|8)!?nE9fiM(NSPkM?QmN6M!)=b!9m;S|XQTpQbe*+gd#~E6oJb1W<~g32I1$_diu>Qy7Rw3=dU(*)Xkf_m^u5@?!F?g%!;3P z#$PQj_4o4DlYhtLK6Fpg>R{C@@z*z7GkDU}~{2s6QQa`UpUbSgnoM`q!VBNCh#qSQumtO_@-l303xp zq3p>)nQ%T&Ex#~m!l86#wqr9ZdqPq6;Gq&the{0w9~1}*_zJ9>+g;iJTh-@(KPcP< z1%d+qN&yu$+sy`tWcSvE!O32mu-vkU39m4yL+I>wtS@9MK4j6xXNg=8Q;UT`*3iO_ NfR-V+pun#x@C9b(5HbJ& literal 0 HcmV?d00001 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..023392d --- /dev/null +++ b/LICENSE @@ -0,0 +1,5 @@ +Copyright (C) 2023 by Humza Shahid + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b571242 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Brolib-sml + +Standard ML port of [this](https://github.com/hummy123/brolib) rope implementation. diff --git a/third-party b/third-party deleted file mode 100644 index 2807c13..0000000 --- a/third-party +++ /dev/null @@ -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 diff --git a/utils.sml b/utils.sml index 578f2a3..726869b 100644 --- a/utils.sml +++ b/utils.sml @@ -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