ormar icon indicating copy to clipboard operation
ormar copied to clipboard

`translate_list_to_dict` method is a bottleneck

Open sorasful opened this issue 2 years ago • 2 comments

These days I'm trying to profile several of my routes, and I notice that it's not the DB calls that takes the most time, but more what comes after, especially translate_list_to_dict function.

I've profiled them with cProfile and the results are always the same, this function take almost 50% of the time.

Here are 2 screenshots:

image image

Describe the solution you'd like I'm wondering if this is a known issue, maybe we can try to brainstorm on how to improve this to take less time ?

Also, i've noticed that check_node_not_dict_or_not_last_node function is being called a huge number of time for a limited number of rows. Maybe there's something we can do about it too.

sorasful avatar Dec 16 '22 17:12 sorasful

These days I'm trying to profile several of my routes, and I notice that it's not the DB calls that takes the most time, but more what comes after, especially translate_list_to_dict function.

I've profiled them with cProfile and the results are always the same, this function take almost 50% of the time.

Here are 2 screenshots:

image image

Describe the solution you'd like I'm wondering if this is a known issue, maybe we can try to brainstorm on how to improve this to take less time ?

Also, i've noticed that check_node_not_dict_or_not_last_node function is being called a huge number of time for a limited number of rows. Maybe there's something we can do about it too.

Thanks for your advise, and paste the test code, will fix and test it please.

ponytailer avatar Jan 29 '23 07:01 ponytailer

@sorasful Did you check again after updating to 12.1?

collerek avatar Feb 03 '23 03:02 collerek