Shudhanshu Singh
d87d26d735
perf(gitdiff): optimize inline diff highlighting using cache ( #38706 )
...
This pull request optimizes code diff highlighting in the PR Files
Changed view, which is a major CPU bottleneck and hot path in
production.
Previously, Gitea executed the expensive `DiffMatchPatch` algorithm
twice for every matching deleted/added line pair (once for the deleted
line, and once for the added line). We now run the diff algorithm once
and cache the resulting `DiffInline` on the `DiffLine` struct itself,
allowing the second line to render via a 0-cost cache lookup.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: silverwind <me@silverwind.io >
2026-07-30 16:43:36 +00:00
..
2026-07-30 09:13:47 +00:00
2026-02-01 10:35:51 +00:00
2026-05-26 15:49:31 -07:00
2026-07-12 17:14:09 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2025-04-09 16:34:38 +00:00
2026-07-30 16:43:36 +00:00
2026-03-31 17:22:18 +00:00
2026-06-08 18:18:58 +00:00
2026-07-24 02:05:38 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-23 08:29:28 +00:00
2026-07-15 17:30:01 +00:00
2026-06-08 18:18:58 +00:00
2026-07-29 12:39:35 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-23 14:31:29 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-30 16:43:36 +00:00
2026-07-12 17:14:09 +00:00
2026-06-14 15:52:37 +02:00
2026-06-04 00:12:02 +08:00
2026-06-04 00:12:02 +08:00
2026-07-28 17:04:22 +00:00
2026-07-17 18:44:31 +08:00
2026-07-27 07:46:00 +00:00
2026-05-29 01:12:11 +00:00
2026-07-20 16:07:38 +00:00
2026-07-17 22:28:59 +08:00
2026-05-26 15:49:31 -07:00
2026-07-26 14:22:49 +00:00
2026-07-21 13:41:54 +00:00
2026-05-26 15:49:31 -07:00
2026-05-29 01:12:11 +00:00
2026-05-26 15:49:31 -07:00
2026-05-29 01:12:11 +00:00
2026-05-26 15:49:31 -07:00
2026-07-12 17:14:09 +00:00
2026-06-03 17:40:38 +00:00
2026-07-17 22:28:59 +08:00
2026-07-17 22:28:59 +08:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-28 06:14:52 +00:00
2026-07-27 07:46:00 +00:00
2026-05-26 15:49:31 -07:00
2026-07-08 23:52:06 +02:00
2026-05-26 15:49:31 -07:00
2026-07-28 17:04:22 +00:00
2026-05-26 15:49:31 -07:00
2025-02-21 00:05:40 +08:00
2026-07-27 15:35:48 +00:00
2026-07-27 07:46:00 +00:00
2026-06-14 18:26:22 +00:00
2026-07-04 22:30:12 +02:00
2026-07-23 14:31:29 +00:00
2026-07-27 16:55:27 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2025-01-21 18:57:07 +00:00
2026-07-23 14:31:29 +00:00
2026-07-29 12:39:35 +00:00
2026-07-27 07:46:00 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-12 11:33:14 +00:00
2026-03-26 00:37:48 +08:00
2026-05-26 15:49:31 -07:00
2026-07-12 17:14:09 +00:00
2025-01-09 09:21:47 +08:00
2026-07-28 17:04:22 +00:00
2026-05-26 15:49:31 -07:00
2026-07-27 07:46:00 +00:00
2026-02-20 16:12:22 +00:00
2026-06-04 13:38:56 +00:00