Best Studio 1
Best Studio
Agora Metin2 1
Agora Metin2
raderde 1
raderde
Cannn6161 1
Cannn6161
noisiv 1
noisiv
Manwe Work 1
Manwe Work
Mt2Hizmet 1
Mt2Hizmet
melankolıa18 1
melankolıa18
romegames 1
romegames
Krutzo 1
Krutzo
shrpnl 1
shrpnl
Hikaye Ekle
Reklam vermek için turkmmo@gmail.com

[C++] Define Parser

Icecloud

Level 1
Üye
Katılım
25 Haz 2019
Konular
1
Mesajlar
15
Online süresi
20h 48m
Reaksiyon Skoru
3
Altın Konu
0
TM Yaşı
6 Yıl 11 Ay 17 Gün
Başarım Puanı
52
MmoLira
764
DevLira
3
Ticaret - 0%
0   0   0

ROHAN2 WORLD 1-120 TR TİPİ OFFICIAL YOHARA, BALATHOR VE AMON! 80. GÜNÜNDE! +10.000 ONLİNE! HİLE VE BOT %100 ENGELLİ HEMEN TIKLA!

I have written a tool here which extracts the defines from the files and creates data with the contents.

You can “scan” the client/server source at the same time by using this structure

Main folder:
exe
ClientSource/
ServerSource/

Alternatively, do it yourself for each source


Extremely important!!!
If you have errors then write here about Github (I think it's better)

You have improvements ?

Main link




Burada, dosyalardan tanımları çıkaran ve içeriklerle veri oluşturan bir araç yazdım.

Bu yapıyı kullanarak istemci/sunucu kaynağını aynı anda “tarayabilirsiniz”

Ana klasör:
exe
ClientSource/
ServerSource/

Alternatif olarak, her kaynak için bunu kendiniz yapın


Son derece önemli!!!
Hatalarınız varsa buraya Github hakkında yazın (bence daha iyi)

Gelişmeler var mı?

Ana bağlantı
 
Son düzenleme:
#update:
DefineExtractor – Update & Refactor
April 2026

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Build System: CMake

The project has been fully migrated to CMake. No more manual VS project setup required.

• New CMakeLists.txt – C++20, automatic thread library linking
• New CMakePresets.json – Debug and Release selectable directly from the VS toolbar dropdown
Output: build/debug/DefineExtractor.exe
Output: build/release/DefineExtractor.exe
• New CMAKE_VS_SETUP.md – step-by-step build guide for Visual Studio 2022/2026

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Performance Optimizations

Analysis revealed 4 stacked issues causing ~96% CPU load and long runtimes
on large codebases (e.g. 449,000 lines):

1. Double file reading (HIGH)
Every file was read twice — once sequentially upfront for line counting,
then again during actual parsing.
Fix: Line count is now accumulated atomically by worker threads during
parsing. No pre-scan pass at all.

2. regex_search on every single line (HIGH)
A complex 4-branch regex pattern was called on every one of 449k+ lines.
Fix: shouldRunDefineRegex() pre-filter — the regex only fires when both
'#' AND the define name are present in the line (~0.1% of lines).

3. anyIfStartRegex inside every active #ifdef block (MEDIUM)
A regex was used to detect nested #if / #ifdef / #ifndef directives.
Fix: Replaced by isAnyIfStart() — plain string character checks, no regex.

4. getIndent() scanned the entire line (MED#ifdef Used std::accumulate which always iterated to the e#ifof #ifdefrin#ifndef Fix: Now breaks at the first non-whitespace character.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Unit Tests (TDD)

Performance helper functions were extracted into DefineExtractor/helpers.h
and are now fully unit-tested (Red → Green → Refactor cycle).

• Framework: Catch2 v2 (single-header, no external install required)
• 18 tests — all passing
• Coverage: getIndent(), isAnyIfStart(), shouldRunDefineRegex()

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Documentation & Repository

• README.md – fully rewritten: CMake build, presets, test guide,
updated project layout (DE/EN)
• CONTRIBUTING.md – bug reports, feature requests, PR workflow,
code style guidelines (DE/EN)
• SECURITY.md – confidential vulnerability reporting process (DE/EN)
• CODE_OF_CONDUCT.md – community standards, Contributor Covenant 2.1 (DE/EN)
• dependabot.yml – fixed invalid package-ecosystem: "" → "github-actions"
• .gitignore – cleaned up: removed leftover game-server entries,
added build/ and Output/

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst