Optimize driver loading in v2 API¶
Currently, required drivers are loaded in the
__init__ method of v2 API
flask_restful instanciates resources on
each request, meaning that drivers are also loaded on each request. This
leads to sub-optimal performance.
Implement two new classmethods in
reload: Reloads all required drivers.
load: Loads all required drivers by calling
reload. In case the drivers are already loaded, does nothing
In order to be able to persist drivers between class instantiations, they will be set as class attributes.
Data model impact¶
REST API impact¶
Other end user impact¶
The average response time for v2 API endpoints will be reduced.
Loading the drivers only once will result in a performance gain.
Other deployer impact¶
Log messages that appear on driver instantiation will appear only once rather than on each request.
Driver loading will have to be done in the
reload method rather than in
- Primary assignee:
Existing unit tests for the v2 API along with planned tempest tests will test this.
The developer documentation for the v2 API will be updated to include
information about the