[WIP] Add converter result cache for performance improvement#156
Draft
[WIP] Add converter result cache for performance improvement#156
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
denops/ddu/convert_cache.tswith ConverterCache class (LRU+TTL) and singleton exportdenops/ddu/types.tsto addconverterCache,converterCacheMaxEntries,converterCacheTTLto DduOptionsdenops/ddu/context.tsto add defaults indefaultDduOptions()denops/ddu/ddu.tsto integrate cache into converter execution path withmakeConverterCacheKeyand cache hit/miss logicOriginal prompt
目的
Shougo/ddu.vim のパフォーマンス改善のため、core 側に汎用的な converter 結果キャッシュを追加します。COW(Copy-On-Write)や converters の一部で深い clone が発生するケースがあり、特に converter_hl_dir のような重い converter がボトルネックになっているため、converter の結果(DduItem 相当)をキャッシュして再利用することで総コストを削減します。
要件
変更ファイル(追加/修正一覧)
実装詳細(技術的注意)
テスト手順(PR 本文に含める)
後続改善案(PR に追記)
備考
変更を反映する PR タイトル
"feat: add core-side generic converter result cache (LRU+TTL, opt-in)"
作業内容
リポジトリ
Shougo/ddu.vim
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: copyOnWrite オフ
['Load file_rec: 40 ms', '[" matcher_substring: 1 ms items: 1005 -> 1005 inputChanged: false retType: array cloneDelta: 0"," matcher_hidden: 3 ms items: 1005
\ -> 980 inputChanged: false retType: array cloneDelta: 0"," sorter_mtime: 56 ms items: 980 -> 980 inputChanged: false retType: array cloneDelta: 0"]', '[" c
\onverter_hl_dir: 50 ms items: 980 -> 980 inputChanged: false retType: array cloneDelta: 0"]', '[" matcher_substring: 0 ms items: 1860 -> 1860 inputChanged: f
\alse retType: array cloneDelta: 0"," matcher_hidden: 6 ms items: 1860 -> 1811 inputChanged: false retType: array cloneDelta: 0"," sorter_mtime: 48 ms items:
\ 1811 -> 1811 inputChanged: false retType: array cloneDelta: 0"]', '[" converter_hl_dir: 65 ms items: 1811 -> 1811 inputChanged: false retType: array cloneDe
\lta: 0"]', 'Refresh all items: 1305 ms', '[" matcher_substring: 0 ms items: 1860 -> 1860 inputChanged: false retType: array cloneDelta: 0"," matcher_hidden:
\ 3 ms items: 1860 -> 1811 inputChanged: false retType: array cloneDelta: 0"," sorter_mtime: 5 ms items: 1811 -> 1811 inputChanged: false retType: array clone
\Delta: 0"]', '[" converter_hl_dir: 60 ms items: 1811 -> 1811 inputChanged: false retType: array cloneDelta: 0"]', 'Refresh all items: 1595 ms', '[" matcher_
\substring: 10 ms items: 1860 -> 1000 inputChanged: false retType: array cloneDelta: 0"," matcher_hidden: 3 ms items: 1000 -> 979 inputChanged: false retType:
\ array cloneDelta: 0"," sorter_mtime: 3 ms items: 979 -> 979 inputChanged: false retType: array cloneDelta: 0"]', '[" converter_hl_dir: 34 ms items: 979 ->
\979 inputChanged: false retType: array cloneDelta: 0"]', 'Refresh all items: 1878 ms', '[" matcher_substring: 6 ms items: 1860 -> 361 inputChanged: false ret
\Type: array cloneDelta: 0"," matcher_hidden: 0 ms items: 361 -> 35...
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.