comrak icon indicating copy to clipboard operation
comrak copied to clipboard

O(n^2) for inline link parsing

Open mity opened this issue 5 years ago • 0 comments

$ time python -c 'print("[t](/u) " * 10000)' | ./target/release/comrak >/dev/null
real    0m1.599s
user    0m1.593s
sys     0m0.006s

$ time python -c 'print("[t](/u) " * 20000)' | ./target/release/comrak >/dev/null
real    0m6.280s
user    0m6.276s
sys     0m0.004s

$ time python -c 'print("[t](/u) " * 40000)' | ./target/release/comrak >/dev/null
real    0m25.403s
user    0m25.386s
sys     0m0.011s

mity avatar May 20 '19 15:05 mity