perf: оптимизация tag-проверок на горячих путях — сокращение избыточных pmm_resolve (Этап 10.3, Issue #207)#224
Merged
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: netkeep80#207
…ых pmm_resolve (Этап 10.3, Issue netkeep80#207) Оптимизированы горячие пути для сокращения избыточных вызовов pmm_resolve<node>(): - is_number(): единственный tag() вместо трёх отдельных вызовов - is_null(): убрана избыточная проверка is_error() - deref(): единственный pmm_resolve за итерацию - pjson_traverse_subtree/postorder: единственный tag() вместо is_array()+is_object() - pjson_free_node_visitor: n->tag напрямую вместо повторного v.tag() - pjson_count_visitor: единственный pmm_resolve для тега и данных - _walk_path()/erase(): единственный tag() вместо is_object()+is_array() Добавлены 14 тестов. Все 690 тестов проходят. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit 3bd9a56.
Contributor
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
📎 Log file uploaded as Gist (2819KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
Contributor
Author
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pjson_node.h,pjson_db_helpers.h,pjson_db_pmm.hдля сокращения избыточных вызововpmm_resolve<node>()is_number(): единственныйtag()вместо трёх отдельных вызовов (черезis_integer(),is_uinteger(),is_real())is_null(): убрана избыточная проверкаis_error()(уже обрабатывается внутриtag())deref(): единственныйpmm_resolveза итерацию вместо отдельныхis_ref()+ref_target()pjson_traverse_subtree/pjson_traverse_subtree_postorder: единственныйtag()вместо цепочкиis_array()+is_object()pjson_free_node_visitor: используетсяn->tagнапрямую вместо повторногоv.tag()pjson_count_visitor: единственныйpmm_resolveдля получения тега и данных_walk_path()иerase(): единственныйtag()вместо цепочкиis_object()+is_array()tests/test_pjson_tag_opt.cppplan.mdиreadme.mdКонтекст
Это Этап 10.3 (Проблема 10) из plan.md. Каждый вызов
is_string(),is_array(),is_number()и т.д. вызывалtag(), который выполнялpmm_resolve<node>(id). При цепочке проверок один и тот же узел разрешался многократно. Теперь на каждом горячем пути выполняется единственный resolve.Fixes
Fixes #207
Test plan
deps/pmm/pmm.h)🤖 Generated with Claude Code