Skip to content

⚡ Bolt: XML attribute araması önbellekleme ile optimize edildi#23

Open
gitmuhammedalbayrak wants to merge 1 commit into
masterfrom
zaman-xml-cache-optimization-6025450273537315371
Open

⚡ Bolt: XML attribute araması önbellekleme ile optimize edildi#23
gitmuhammedalbayrak wants to merge 1 commit into
masterfrom
zaman-xml-cache-optimization-6025450273537315371

Conversation

@gitmuhammedalbayrak
Copy link
Copy Markdown
Member

Bolt: Performans İyileştirmesi

💡 Ne Yapıldı: zaman::vkt_h_v_d() içerisindeki yavaş find_child_by_attribute doğrusal XML aramaları (O(N)), dayofyear niteliğine göre statik bir dizi üzerinden O(1) önbellek (cache) erişimine dönüştürüldü.
🎯 Neden: zaman sınıfından her nesne türetildiğinde bu arama iki defa (bugün ve yarın için) çalışıyordu. Bu arama, uygulamanın instantiation performansının %50'den fazlasını sömürüyordu.
📊 Etki: Nesne türetme süresi ~%90 oranında azaldı. (100.000 nesne türetimi ~11 saniyeden 0.76 saniyeye düştü).
🔬 Doğrulama: make ve g++ komutlarıyla testler derlenip test_zaman.cpp çalıştırılmış ve tüm verilerin eskisiyle aynı doğruluğu verdiği kanıtlanmıştır. Çalışma dizini temiz bırakılmıştır.


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

`zaman::vkt_h_v_d()` metodunda, her nesne yaratılışında gerçekleştirilen
`pugi::xml_node::find_child_by_attribute` araması `O(N)` karmaşıklığı
ile ciddi bir darboğaz oluşturuyordu.

Bu doğrusal arama yerine, ilgili "prayertimes" düğümlerinin metinleri
ilk nesne çağrısında, 400 elemanlık statik bir string dizisine ("dayofyear"
indeksi ile) yüklenerek (`O(1)` erişim) önbelleğe alındı. Bu değişiklik
ile 100.000 nesne üretimi için geçen süre ~11.3 saniyeden ~0.76 saniyeye
düştü. (Ölçümler `std::cout` I/O gecikmeleri hariç tutularak yapılmıştır.)

Ayrıca, öğrenilen performans çıkarımı `.jules/bolt.md` günlüğüne
eklenmiştir. Tüm birim testleri başarıyla geçmiştir.

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