- Optimized Type.get_all() SQL (improvement for every call)
- Optimized Type.get_all() to only fetch counts where needed (improvement for many calls)
- Moved file stat functions from
__init__.pyto where it is needed (improvement for many calls)
Updated by Bernhard Koschiček-Krombholz 2 months ago
I tested some performance with Thanados data. Besides some operations are being slow due high linkage, I found another performance issue.
Views and API calls in Thanados always take at a minimum of 3 seconds. In fact, it takes 3 seconds that the view/API code is even reached. So I looked into the
__init__.py and found the two baddies:
g.file_stats = get_file_stats() ~ 1.5 seconds (Thanados has over 17.000 files)
g.types = Type.get_all() ~ 1.15 seconds (Thanados has 3853 types)
These two are responsible for the delay.
Updated by Alexander Watzinger about 2 months ago
Can be tested with a bigger project data set when e.g. calling:
Updated by Alexander Watzinger about 1 month ago
Today we looked into Type.get_all() at
__init__.py and it looks like most of the cost comes from determining the count for entities using that type.
Next session we will try to make a switch at Type.count_all() to only get counts when needed (e.g. at type views).