TWSD-1219 - Observing webui slowness for all the Tabs ||AS-25856|| JHSDC
Review Request #1170 — Created Nov. 17, 2025 and submitted
| Information | |
|---|---|
| shuinvy | |
| AVX2 | |
| rel_avx_2_7_5 | |
| TWSD-1219 | |
| Reviewers | |
| austin, stevenku | |
Fix slowness issue for API related to _field_group
In the framework, is will call CLI due to amount of fields for group.
For example,
there are 7 fields for group_name=webui_settings,
so it will call CLI 14 times(7 times for get value, 7 times for transfering value to string).How to solve the issue:
I use benchmarking to check where is the code slowness,
then found there is function start from get_ by the group name(That is, get_webui_settings).
So I modified the function get_field_by_instance in manager.py.
If there is group for this field,
and there is function start from get and be combined with group name,
if there is data is DelayedQuery, we will call this function once to get value for all fields.
For example, the first field is "enable_webui",
because there is no data for this field at first,
and there is field_group for this field,
it will call get_webui_settings for manager of the Model(AccessControl).
then the function get_webui_settings will return data for all fields:
data = getattr(self, '_get_' + group.name)()
We use loop to set each field to the instance itself,
then return result of get enable_webui.
Next time, it will try to get data of "webui_authmandatory",
but the data is not DelayedQuery anymore,
then it just return data that we already set in instance.I have checked all pages for field_group function.
