mobile: avoid YAML/JSON parsing step during Envoy initialization
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 430
Description
**Stop configuring Envoy Engine with the use of a huge string config.**
As it is now Envoy engine builder on all platforms configures Envoy by creating a huge string config which is then passed to the engine where it's parsed by YAML and/or JSON parsers. This string is based off the content of config.cc file and it's manipulated by engine_builder
This has a few negative consequences:
- YAML/JSON parsing steps are expensive - they can cause a big performance impact and there is often no way around them.
- We often end up having to modify the config using string manipulation operations which cause further performance impact i.e. add tens/hundreds of virtual cluster configs requires a lot of string concatenation operations.
- Working with a huge string is error prone, no type (or any other really) checks that can help you to catch issues before you learn that the app just crashes on app launch
We noticed a big performance impact of string manipulation/parsing operations when adding around 700-900 virtual cluster configs to Envoy builder and starting the engine:

The flame chart was captured on Android platform. Eyeballing the attached flame chart that was used to capture the initialization of Envoy Engine we can see that parsing JSON/YAML accounted for around 3-40% of the whole Envoy engine initialization time.
Contributor guide
Assessment
This issue has not been assessed yet.