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

Speedups to FakeSymbolTableTest based on microbenchmarks from #6161. #6293

Merged
merged 15 commits into from
Apr 2, 2019

Conversation

jmarantz
Copy link
Contributor

Description: Pulls out a suite of improvements to FakeSymbolTable from #6161 -- that PR has grown too big to and this one of a series of logical partitions that can be broken out and reviewed. #6161 itself was intended as a less risky stepping stone to #4980 which changes the base representation fo all stat names to use a symbol table.

Risk Level: low currently -- this is not used yet, but in another PR it soon will be.
Testing: //test/common/stats/...
Docs Changes: n/a
Release Notes: n/a

@dnoe
Copy link
Contributor

dnoe commented Mar 15, 2019

I've asked @ambuc to take a look at this, then I will assign a senior maintainer. Thanks @ambuc !

jmarantz added a commit to jmarantz/envoy that referenced this pull request Mar 15, 2019
ambuc
ambuc previously approved these changes Mar 17, 2019
Copy link
Contributor

@ambuc ambuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a lot of very small nits and questions but overall this LGTM.

My main issue is that this PR adds a bit of temporary complexity without a manifest for which of the new methods get removed and when. If you have github issues for the future work, please add TODO(issue/<num>) or TODO(jmarantz): Remove after issue/num comments inline.

include/envoy/stats/symbol_table.h Show resolved Hide resolved
include/envoy/stats/symbol_table.h Outdated Show resolved Hide resolved
source/common/stats/symbol_table_impl.h Show resolved Hide resolved
source/common/stats/symbol_table_impl.h Outdated Show resolved Hide resolved
source/common/stats/symbol_table_impl.h Show resolved Hide resolved
source/common/stats/symbol_table_impl.cc Show resolved Hide resolved
source/common/stats/fake_symbol_table_impl.h Show resolved Hide resolved
source/common/stats/fake_symbol_table_impl.h Show resolved Hide resolved
source/common/stats/fake_symbol_table_impl.h Show resolved Hide resolved
source/common/stats/fake_symbol_table_impl.h Outdated Show resolved Hide resolved
Signed-off-by: Joshua Marantz <[email protected]>
Copy link
Contributor Author

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really excellent comments, @ambuc -- thanks for going through all of this.

include/envoy/stats/symbol_table.h Show resolved Hide resolved
include/envoy/stats/symbol_table.h Show resolved Hide resolved
include/envoy/stats/symbol_table.h Outdated Show resolved Hide resolved
source/common/stats/fake_symbol_table_impl.h Outdated Show resolved Hide resolved
source/common/stats/symbol_table_impl.cc Outdated Show resolved Hide resolved
source/common/stats/symbol_table_impl.h Outdated Show resolved Hide resolved
source/common/stats/symbol_table_impl.h Show resolved Hide resolved
source/common/stats/symbol_table_impl.h Outdated Show resolved Hide resolved
source/common/stats/symbol_table_impl.h Show resolved Hide resolved
source/common/stats/symbol_table_impl.h Outdated Show resolved Hide resolved
@jmarantz
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

🔨 rebuilding ci/circleci: tsan (failed build)

🐱

Caused by: a #6293 (comment) was created by @jmarantz.

see: more, trace.

@jmarantz
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

🔨 rebuilding ci/circleci: tsan (failed build)

🐱

Caused by: a #6293 (comment) was created by @jmarantz.

see: more, trace.

@jmarantz jmarantz requested a review from mattklein123 March 20, 2019 14:29
@jmarantz
Copy link
Contributor Author

@mattklein123 I think this is ready for a look.

@jmarantz jmarantz requested a review from zuercher March 26, 2019 13:39
@jmarantz
Copy link
Contributor Author

@zuercher would you have time to look at this? Nothing too dramatic in here I think. This lacks a cross-company review so I don't want to ask Harvey or Alyssa.

@mattklein123 mattklein123 self-assigned this Apr 1, 2019
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from a high level skim. A couple of small comments. Thank you!

/wait

* @param num_names The number of names.
* @param symbol_table The symbol table in which to encode the names.
*/
virtual void populateList(absl::string_view* names, int32_t num_names, StatNameList& list) PURE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: s/int32_t/uint32_t

Where is this storage coming from? Do we need to use a pointer/length vs. using std:array/std::vector or something like that?

/**
* Since SymbolTable does manual reference counting, a client of SymbolTable
* must manually call free(symbol_vec) when it is freeing the backing store
* for a StatName. This way, the symbol table will grow and shrink
* dynamically, instead of being write-only.
* dynamically, instead of being write-only
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: revert?

@jmarantz
Copy link
Contributor Author

jmarantz commented Apr 1, 2019

/retest

@repokitteh-read-only
Copy link

🔨 rebuilding ci/circleci: release (failed build)

🐱

Caused by: a #6293 (comment) was created by @jmarantz.

see: more, trace.

@jmarantz jmarantz merged commit fd273a6 into envoyproxy:master Apr 2, 2019
@jmarantz jmarantz deleted the fake-symtab-speedup branch April 2, 2019 01:26
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.

4 participants