Feature #2045
closed
Added by Bernhard Koschiček-Krombholz about 1 year ago.
Updated 10 months ago.
Description
Improved pre request time
- 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__.py
to where it is needed (improvement for many calls)
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.
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Status changed from Acknowledged to In Progress
- Target version changed from 8.0.0 to 7.17.0
- Description updated (diff)
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).
- Subject changed from API: Performance to Performance
- Description updated (diff)
- Description updated (diff)
- Category changed from API to Backend
- Status changed from In Progress to Closed
Also available in: Atom
PDF