Explore O(1) exact-name directory queries (GetDirInfoByName) and DirInfo caching

Aperta
#8 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
performance

Direzione di ricerca

Read DirectoryNode::findChild and fillDirInfo to see how exact-name lookups can use the existing child map, then check WinFsp's dirctl.c for when directory listings are cached. Implement and measure the proposed query and cache changes using the perf-profiling per-callback profiler; done means confirming the behavior and comparing compile performance with many header lookups.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Follow-up from reviewing #5.

Current state

  • Name resolution (Open/GetFileInfo) is O(1) per path component: DirectoryNode::findChild uses a lowercased unordered_map key.
  • Exact-name directory queries (e.g. FindFirstFile("hello.exe"), which cmd does when it searches for an executable by bare name) are O(n):
    • before #5, SetPassQueryDirectoryPattern(TRUE) meant filterDirectoryContents ran GlobMatcher over every child
    • after #5 (FALSE), the full listing goes to the WinFsp driver, which filters it with FsRtlIsNameInExpression
  • No DirInfoTimeout is set (only FileInfoTimeout(1000)), so the driver doesn't cache directory listings.

To explore

  1. PassQueryDirectoryFileName(TRUE) + GetDirInfoByName: WinFsp calls GetDirInfoByName for patterns without wildcards. Implement it with findChild + fillDirInfo to get O(1) exact-name queries. Wildcard patterns still go through the driver's matching, so the DOS-wildcard fix from #5 is kept.
  2. DirInfoTimeout: let the driver cache directory listings. Verify in the WinFsp source (dirctl.c) whether that cache is only used when the pattern is not passed down. #5 now allows that case.
  3. Measure the impact on a typical compile (e.g. many header lookups in big include directories), using the per-callback profiler from perf-profiling.
Lingua principale
C++
Stelle
1
Fork
0
Merge medio
23m
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.