Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory optimization #436

Closed
wants to merge 9 commits into from
Closed

Conversation

hjanetzek
Copy link

Hi!
I've started looking into optimizing yaml-cpp. I can split this PR up if you interested only in parts of it.

  • It seems node_ref was superfluous, delegating all calls to node_data.

  • shared_ptr is heavy. We don't need atomic ref counting nor weak_ptr. This adds a simple intrusive ref_counted base used by node_data, memory and memory_holder. ref_holder manages ref_counted objects.

  • No need for memory using a map to hold nodes. Memory can be merged by just concatenating the node items.

  • Node does not need to have an m_isValid member: It is implicitly valid if it has a memory_holder.

If any of these changes are stupid - please let me know :)

@hjanetzek hjanetzek force-pushed the memory-optimization branch 2 times, most recently from 5ca8564 to cc85340 Compare November 24, 2016 16:34
- simplify memory management
a Node is valid when its shared_memory_holder is not null
- unnecessary level of indirection
@hjanetzek hjanetzek closed this Nov 19, 2018
@hjanetzek hjanetzek deleted the memory-optimization branch November 19, 2018 11:09
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.

None yet

1 participant