Commit f69ee075 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: Improve perfomance

parent 859aad11
...@@ -104,11 +104,17 @@ ...@@ -104,11 +104,17 @@
extended_search_mapping: {}, extended_search_mapping: {},
graph_gadget: "unsafe/gadget_field_graph_echarts.html" graph_gadget: "unsafe/gadget_field_graph_echarts.html"
}, },
/*performance_mapping = { performance_mapping = {
"translated_simulation_state_title": [ "translated_simulation_state_title": [
"simulation_state", "getTranslatedSimulationStateTitle" "simulation_state", "getTranslatedSimulationStateTitle"
],
"translated_validation_state_title": [
"validation_state", "getTranslatedValidationStateTitle"
],
"translated_causality_state_title": [
"causality_state", "getTranslatedCausalityStateTitle"
] ]
},*/ },
domain_list, domain_list,
i, i,
j; j;
...@@ -123,16 +129,20 @@ ...@@ -123,16 +129,20 @@
group_by = options.group_by; group_by = options.group_by;
} }
/* XXX - Improve the perfomance changing the parameter in the select_list is not working properly /* Replace the key (group_by) using performance_mapping to use SQL indexes in a more efficient way.
For example, use getTranslatedSimulationStateTitle instead of translated_simulation_state_title
Group by translated_simulation_state_title will increase the number of SQL join.
For example, use getTranslatedSimulationStateTitle and simulation_state instead of
translated_simulation_state_title
*/ */
/*for (i = 0; i < group_by.length; i += 1) { for (i = 0; i < group_by.length; i += 1) {
if (performance_mapping.hasOwnProperty(group_by[i])) { if (performance_mapping.hasOwnProperty(group_by[i])) {
options.layout.x.key = performance_mapping[group_by[i]][1]; options.layout.x.key = performance_mapping[group_by[i]][1];
data.x = options.layout.x.key; data.x = options.layout.x.key;
group_by[i] = performance_mapping[group_by[i]][0]; group_by[i] = performance_mapping[group_by[i]][0];
} }
}*/ }
data.y = "count(*)"; data.y = "count(*)";
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1007.6054.5919.58094</string> </value> <value> <string>1007.7141.47221.20428</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1679002058.79</float> <float>1679067473.94</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment