Commit Graph

1 Commits

Author SHA1 Message Date
saqut 087d1b20a6 perf(tokenizer): switch dispatch + unordered_map keyword lookup
Ö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
2026-06-18 18:35:10 +03:00