Skip to content

⚡ Bolt: [performans iyileştirmesi] String bellek şişmesini ve tekrar atamaları engelle#50

Open
gitmuhammedalbayrak wants to merge 1 commit into
masterfrom
bolt/optimize-string-append-9059279853879366757
Open

⚡ Bolt: [performans iyileştirmesi] String bellek şişmesini ve tekrar atamaları engelle#50
gitmuhammedalbayrak wants to merge 1 commit into
masterfrom
bolt/optimize-string-append-9059279853879366757

Conversation

@gitmuhammedalbayrak

Copy link
Copy Markdown
Member

💡 What (Ne Yapıldı)
src/src-class/Zaman.cpp içindeki vkt_turk_v_d ve sat_turk_v_d fonksiyonlarında simdiki_zaman_turk ve vakit değişkenlerine (örneğin istibak_nucum) .append() kullanılarak yapılan eklemeler yerine = atama operatörü kullanıldı. Ayrıca gereksiz cached_nodes double init kaldırıldı.

🎯 Why (Neden Yapıldı)
Bu fonksiyonlar nesne hayat döngüsünde birden çok kez çağrıldığında std::string'in ucu açık şekilde sürekli büyümesine (örn. 8 karakterden 800008 karaktere) ve C++'ın sürekli belleği "reallocate" etmesine neden oluyordu. Bu durum çok ciddi performans kayıplarına ve bellek sızıntısı (memory leak) benzeri şişmelere yol açıyordu.

📊 Impact (Etkisi)
String'lerin uzunluğu sabitlendiği için uzun soluklu çalışmalardaki gereksiz dinamik bellek tahsisi işlemleri tamamen durduruldu. Performans testi ile (100.000 iterasyonda) bellekteki aşırı büyüme probleminin tamamen kalktığı ölçüldü ve gereksiz bellek taşmaları önlendi.

🔬 Measurement (Nasıl Doğrulanır)
Birim testleri tests/test_zaman.cpp kullanılarak derlenip çalıştırılabilir. Bütün fonksiyonelliklerin eskisi gibi korunduğu ve hiçbir testin kırılmadığı görülmüştür. Ayrıca test için yazılan küçük benchmarklarda uzunluk sorununun %100 oranında önlendiği tespit edilmiştir.


PR created automatically by Jules for task 9059279853879366757 started by @gitmuhammedalbayrak

zaman::vkt_turk_v_d ve zaman::sat_turk_v_d metodlarında sürekli append çağrılmasından kaynaklı string büyümesi düzeltildi.

Co-authored-by: gitmuhammedalbayrak <44205174+gitmuhammedalbayrak@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant