test-fullautomation / python-jsonpreprocessor

A preprocessor for json files
Apache License 2.0
2 stars 2 forks source link

Performance issues #282

Closed HolQue closed 4 weeks ago

HolQue commented 1 month ago

In the past the time needed for the computation of some test code snippets, was approximately 1 second and lesser.

With https://github.com/test-fullautomation/python-jsonpreprocessor/pull/280 the computation time of some code snippets increased up to 4 seconds, in some cases to 8 - 16 seconds.

Examples (time increased to ~ 4 sec, scope: params.global)

"teststring/1"  : "teststring/1 value",
${params.global.teststring/1} : "${params.global.teststring/1} extended"
"list_param" : ["A", "B", "C"],
"val2"       : "${params.global.list_param[1]}"
"dict_param" : {"A" : 1 , "B" : 2},
"list_param" : ["A", "B", "C"],
"val3"       : "${params.global.list_param[${params.global.dict_param}['A']]}"
"dict_param" : {"A" : 1 , "B" : 2},
"list_param" : ["A", "B", "C"],
"val4"       : "${params.global.list_param[${params.global.dict_param}[${params.global.list_param}[0]]]}"
"dict_param" : {"A" : 1 , "B" : 2},
"list_param" : ["A", "B", "C"],
"val5"       : "${params.global.list_param[${params.global.dict_param}['${params.global.list_param}[0]']]}"

Example (time increased to ~ 8 - 16 sec, scope: params.global)

"teststring*1"  : "teststring*1 value",
${params.global.teststring*1} : "${params.global.teststring*1} extended"

This should be investigated.

test-fullautomation commented 1 month ago

Hi @namsonx , please fix this urgently. Thank you, Thomas

namsonx commented 1 month ago

Hello Holger,

Thank you very much for your findings! This issue occurred due to my mistake; I forgot to update a pattern back while trying to improve my code. I pushed the tiny change (commit ba1003b3922) to make the time needed for the computation less than 1 seconds.

Thank you, Son

HolQue commented 1 month ago

Retest successful. Issue can be closed.

test-fullautomation commented 4 weeks ago

integrated in RobotFramework AIO 0.11.0