MyNixOS website logo
Description

Text lines and ropes.

A wrapper around Text for fast line/column navigation and logarithmic concatenation.

text-rope Hackage Stackage LTS Stackage Nightly

A wrapper around Text for fast line/column navigation and logarithmic concatenation.

Here are benchmarks for 1000 edits over 70K text:

Split at position
  Unicode
    text-rope:
      3.09 ms ±  94 μs
    yi-rope:
      49.4 ms ± 1.4 ms, 15.98x
  UTF-16
    text-rope:
      3.09 ms ± 106 μs
    rope-utf16-splay:
      10.6 ms ± 337 μs, 3.44x
Split at offset
  Unicode
    text-rope:
      3.04 ms ± 112 μs
    core-text:
      14.0 ms ± 297 μs, 4.59x
    yi-rope:
      6.25 ms ± 102 μs, 2.06x
  UTF-16
    text-rope:
      3.40 ms ±  70 μs
    rope-utf16-splay:
      8.92 ms ± 169 μs, 2.62x

For 10000 edits over 700K text:

Split at position
  Unicode
    text-rope:
      62.9 ms ± 4.2 ms
    yi-rope:
      568  ms ±  31 ms, 9.04x
  UTF-16
    text-rope:
      61.0 ms ± 3.9 ms
    rope-utf16-splay:
      325  ms ±  13 ms, 5.32x
Split at offset
  Unicode
    text-rope:
      59.6 ms ± 3.8 ms
    core-text:
      209  ms ±  15 ms, 3.50x
    yi-rope:
      105  ms ± 7.4 ms, 1.76x
  UTF-16
    text-rope:
      63.6 ms ± 5.3 ms
    rope-utf16-splay:
      230  ms ± 9.0 ms, 3.62x

For 100000 edits over 7M text:

Split at position
  Unicode
    text-rope:
      963  ms ±  43 ms
    yi-rope:
      6.379 s ± 138 ms, 6.62x
  UTF-16
    text-rope:
      988  ms ±  19 ms
    rope-utf16-splay: T
      57.408 s ± 4.24 s, 58.12x
Split at offset
  Unicode
    text-rope:
      1.014 s ±  70 ms
    core-text:
      3.008 s ± 138 ms, 2.97x
    yi-rope:
      1.716 s ±  76 ms, 1.69x
  UTF-16
    text-rope:
      1.065 s ±  53 ms
    rope-utf16-splay:
      38.852 s ± 568 ms, 36.49x
Metadata

Version

0.3

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows