From 7ea58a2b38394cf6beebaf990cf0871c34113a2c Mon Sep 17 00:00:00 2001 From: humzashahid Date: Sun, 24 Mar 2024 13:10:09 +0000 Subject: [PATCH] add performance section to readme --- README.md | 10 ++++++++++ mlton | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) delete mode 160000 mlton diff --git a/README.md b/README.md index bc40efc..de4a50c 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,13 @@ The two files are `rope.sml` and `tiny_rope.sml`. Except for the line-based operations `appendLine` and `foldLines`, all functions are the same between the two (aside from `verifyLines` which is just for testing purposes). Examples of usage can be found in [`examples.sml`](https://github.com/hummy123/brolib-sml/blob/main/examples.sml). + +## Performance + +These two ropes are both quite fast. I compared the OCaml port with the other text data structures in OCaml, and it beat those handily when processing the datasets from [here](https://github.com/josephg/editing-traces) which just test insertion and deletion. It was also faster at performing substrings than the others. + +I don't know other Standard ML libraries to compare it to, but with MLton, this rope implementation beats [the fastest ropes in Rust](https://github.com/josephg/jumprope-rs#benchmarks) at insertion and deletion quite easily, never going 1 ms in the slowest dataset. + +I don't know how to explain this result, but I assume most of the credit goes to the MLton compiler. It also seems likely that this is slower or string queries, as those Rust implementations use cache-friendly B-Trees as opposed to the binary tree used here. + +(Note to self: worth giving numbers.) diff --git a/mlton b/mlton deleted file mode 160000 index fd6d870..0000000 --- a/mlton +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fd6d8705780ea6e223c91a6b33553be1633c4eab