A library for comparing two HTML files/snippets and highlighting the differences using simple HTML. Includes support for comparing complex lists and tables
Its obvious that introducing multibyte support was the big performance hit, however, it is not needed most of the time.
I realized it is pretty easy to determine if this is the case by comparing the result of strlen($text) to mb_strlen($text) and enabled / disabled mb_ functions accordingly. And this fixed the issue.
I also did some small performance fixes by doing some more strict checking, and making the internal php call graph smaller. Used a profiler to fix these issues (xhprof). However the problem was that by decreasing the call-stack I think my biggest performance improvements came from the profiler having less of a hard time keeping up
Hi Josh,
After reading about all the performance troubles on the Drupal forums and in the issue https://github.com/caxy/php-htmldiff/issues/77 I thought i'd try to fix it.
Its obvious that introducing multibyte support was the big performance hit, however, it is not needed most of the time.
I realized it is pretty easy to determine if this is the case by comparing the result of
strlen($text)
tomb_strlen($text)
and enabled / disabled mb_ functions accordingly. And this fixed the issue.I also did some small performance fixes by doing some more strict checking, and making the internal php call graph smaller. Used a profiler to fix these issues (xhprof). However the problem was that by decreasing the call-stack I think my biggest performance improvements came from the profiler having less of a hard time keeping up