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

Fix attribute performance issues in node.read (Chef-17) #12743

Merged
merged 2 commits into from Mar 31, 2022

Conversation

lamont-granquist
Copy link
Contributor

backport of #12742

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
This makes it so that callers can call the deep merge cache
more or less directly so that we're not hanging onto a weird
Hash-of-ImmutableMashes structure.

Care still needs to be taken to consider the fact that:

- the deep merge cache may not be merged for a given keys since
  it is lazily created, so we need to hit the top level accessor
  once to make sure the key is merged before we access it.

- the top-level "give me it all" case where the path is totally
  empty is still handled by doing a manual deep merge of everything.

Once that is done we can call APIs like read/read!/exist? directly
on the ImmutableMash and have fewer edge cases to deal with.

This has the same perf speedup that the prior approach does and
keeps attribute mangling down to 1% of my runtime on my own cookbooks

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
@lamont-granquist lamont-granquist requested review from a team as code owners March 30, 2022 23:59
@lamont-granquist lamont-granquist merged commit b85e8b8 into chef-17 Mar 31, 2022
@lamont-granquist lamont-granquist deleted the lcg/fix-attribute-performance-issues2 branch March 31, 2022 00:54
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