Önceki: for döngüsü içinde her token için include() 63 kez çağrılıyordu
→ 66.9M include() çağrısı, zamanın %81'i
Sonraki:
- Operatör/delimiter: switch(c0) + getchar(1) ile O(1) dispatch
- Keyword: readIdentifier() → unordered_map::find() O(1) lookup
- include() yalnızca // /* */ için (2-3 çağrı/yorum satırı)
Sonuç (2.3MB, 90K satır, debug build):
tokens: 11.5s → 2.4s (−79%)
check: 12.7s → 3.7s (−71%)
gprof ÖNCE: %81 include() (66.9M çağrı)
gprof SONRA: include() %0.00 — artık ölçülemez
Profil dosyaları: docs/perf-before.txt, docs/perf-after.txt
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| CMakeFiles | ||
| .ninja_deps | ||
| .ninja_log | ||
| CMakeCache.txt | ||
| build.ninja | ||
| cmake_install.cmake | ||