Conversation
|
I can't see a single open issue or pull request in the now vendored stringdiff project. In fact, I can't find any report of poor performance there at all. So how did you came to the conclusion, it's no longer maintained? |
|
oh, wow! I had no idea I definitely can apply these performance fixes upstream. |
|
@yurique don't worry about it, I'm happy to take OSS code and patch/maintain it as necessary. You don't need to feel obliged to support it unless you really want to! |
TBH, that's a worst case usage scenario an OSS author and maintainer can face. |
|
I applied the changes and one of the tests is failing, although it's a subtle difference (the white-space): Now I'm trying to find why. (I even reverted those |
|
If anyone is curious (and it took me a LOT of printlns :) ) - the difference was happening because the old version (with views) had a hidden subtle bug. There is a piece that moves whitespaces around when normalizing diffs: def moveWhitespace(
diff: List[DiffElement[IndexedSeqView[String]]]
): List[DiffElement[IndexedSeqView[String]]] =
ListScan(diff) {
case InSecond(second) :: InBoth(Whitespace(both)) :: InFirst(first) :: tail if first == second => // <---
Nil -> (
InFirst(both) :: InBoth(second) :: InSecond(both) :: tail
)
case InFirst(first) :: InBoth(Whitespace(both)) :: InSecond(second) :: tail if first== second => // <---
Nil -> (
InSecond(both) :: InBoth(second) :: InFirst(both) :: tail
)
...It was comparing views with |
|
Version |
Assertions like
assert(Seq.tabulate(500)(identity) == Nil)would hang when rendering the diff due to non-linear performance slowdowns when comparing elements. It seems likely caused by usage ofViews throughoutapp.tulz::stringdiff:0.3.4.stringdiffseems unmaintained, and fixing it required more changes than could be done easily when shading in thebuild.millfile, so I just vendored the whole thing inutest/src/utest/shaded/stringdiff/and fixed it up in place