-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[sonic-cfggen] optimize sonic-cfggen startup #3658
Conversation
a lot of template rendering causes switch to start longer because jinja2 needs to parse them. Introducing RedisBytecodeCache to store parsed buckets of internal template bytecode to speedup same template rendering during start Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
do you have a benchmark number? |
@lguohan |
src/sonic-config-engine/sonic-cfggen
Outdated
@@ -16,6 +16,16 @@ See usage string for detail description for arguments. | |||
""" | |||
|
|||
from __future__ import print_function | |||
|
|||
# mokey patch re.compile to do lazy regular expression compilation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mokey [](start = 2, length = 5)
typo #Closed
src/sonic-config-engine/lazy_re.py
Outdated
|
||
re.compile = __re_compile | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several code format issues. Please check http://pep8online.com #Closed
def __init__(self, client): | ||
self._client = client | ||
try: | ||
self._client.connect(self._client.STATE_DB, retry_on=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STATE_DB [](start = 46, length = 8)
use another non-used database?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I use db index 8 and update swss-common/swss-sdk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have a benchmark for RedisBytecodeCache improvement? #Closed |
@stepanblyschak , i agree with all comments. good ideas! |
please address other reviewers comments. |
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)