After upgrade to 4.0 webpages very slow response

Hi all,

this is my very first post although I have been using Django 3.x for almost 9 months. As i am in the start of my project still, i thought now is a good time to upgrade to Django 4.0, so i did.
But, now pages load very slow fetching from my MySQL database, used to be very fast, instantaneously as not very big tables yet.
Thus, I loaded the latest version debug_bar to see where the time is spent. It shoiws that MySQL is still lightning fast but the time seems to go in deprecation.py to look for Async calls, but i am stil using only the WSGI and I am using the development server, see below:

PS C:\fcls\fcl\fcl1> python manage.py runserver 8080
Watching for file changes with StatReloader
Performing system checks…

System check identified no issues (0 silenced).
February 18, 2022 - 07:21:20
Django version 4.0.1, using settings ‘fcl1.settings’
Starting development server at http://127.0.0.1:8080/
Quit the server with CTRL-BREAK.
[18/Feb/2022 07:21:42] “GET /basis/ HTTP/1.1” 200 69722
[18/Feb/2022 07:21:43] “GET /static/fucanglong-style.css HTTP/1.1” 304 0
[18/Feb/2022 07:21:43] “GET /static/debug_toolbar/css/toolbar.css HTTP/1.1” 304 0
[18/Feb/2022 07:21:43] “GET /static/debug_toolbar/js/toolbar.js HTTP/1.1” 304 0
[18/Feb/2022 07:21:43] “GET /static/debug_toolbar/css/print.css HTTP/1.1” 304 0
[18/Feb/2022 07:21:43] “GET /static/debug_toolbar/js/utils.js HTTP/1.1” 304 0
[18/Feb/2022 07:22:04] “GET /favicon.ico HTTP/1.1” 200 10529
[18/Feb/2022 07:30:00] “GET /debug/render_panel/?store_id=413f26f8f27445809712b92471bb435a&panel_id=ProfilingPanel HTTP/1.1” 200 219225

If i look in side panel profiling (2 list below - due to size limitation) i see a ton of deprecation checks eating time, is this the problem or am i missing something? Or why was Django 3.9 fast and 4.0 so slow?

Any help appreciated as my application is still very small but response times of 20 to 30 seconds or more on localhost where the exact same application did under 1 sec to 2 seconds is not very nice.

Fetching 4 records (select * from Assets 8 columns, 4 rows, 835 Bytes only)

C:\fcls\Python310\lib\site-packages\debug_toolbar\panels/init.py in process_request(184) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.230 0.038 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.038 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.230 0.038 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.038 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.230 0.038 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.038 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.230 0.038 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.038 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.230 0.038 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.230 0.230 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.112 0.112 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.112 0.112 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.118 0.118 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.118 0.118 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.230 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.230 0.038 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.230 0.230 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.112 0.112 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.112 0.112 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.112 0.112 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.111 0.111 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.118 0.118 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.118 0.118 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.116 0.116 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.116 0.039 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.230 0.038 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.038 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.230 0.038 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.230 0.230 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.112 0.112 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.112 0.112 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.118 0.118 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.118 0.118 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.230 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.230 0.038 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.230 0.230 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.112 0.112 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.112 0.112 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.112 0.112 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.111 0.111 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_table(99) 0.111 0.111 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_tables2/config.py in configure(33) 0.110 0.110 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.118 0.118 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.118 0.118 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.116 0.116 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.116 0.039 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\test/utils.py in instrumented_test_render(95) 0.116 0.029 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\dispatch/dispatcher.py in send(149) 0.060 0.015 0.000 0.000 4
C:\fcls\Python310\lib\site-packages\django\template/base.py in render(976) 0.058 0.015 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.230 0.038 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.038 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.230 0.038 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.038 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.230 0.038 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.230 0.230 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.112 0.112 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.112 0.112 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.118 0.118 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.118 0.118 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.230 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.230 0.038 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.230 0.230 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.112 0.112 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.112 0.112 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.112 0.112 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.111 0.111 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.118 0.118 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.118 0.118 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.116 0.116 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.116 0.039 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.230 0.230 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.230 0.230 0.000 0.000 1

… more deleted

From same database but now (select * from Basis 24 columns, 249 rows, 48 Kilo Bytes only)

C:\fcls\Python310\lib\site-packages\debug_toolbar\panels/init.py in process_request(184) 1.236 1.236 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.236 1.236 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.234 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.234 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.234 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.234 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.675 0.675 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.552 0.552 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.233 1.233 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.675 0.675 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.674 0.674 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.541 0.541 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.541 0.180 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.234 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.675 0.675 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.552 0.552 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.233 1.233 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.674 0.674 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_table(99) 0.674 0.674 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_tables2/config.py in configure(33) 0.670 0.670 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.541 0.541 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.541 0.180 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\test/utils.py in instrumented_test_render(95) 0.537 0.134 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\dispatch/dispatcher.py in send(149) 0.255 0.064 0.000 0.000 4
C:\fcls\Python310\lib\site-packages\django\template/base.py in render(976) 0.284 0.071 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.234 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.234 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.675 0.675 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.552 0.552 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.233 1.233 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.675 0.675 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.674 0.674 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.541 0.541 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.541 0.180 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.234 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.675 0.675 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.552 0.552 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.233 1.233 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.674 0.674 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_table(99) 0.674 0.674 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/config.py in configure(33) 0.670 0.670 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/tables.py in paginate(563) 0.670 0.670 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core/paginator.py in page(74) 0.670 0.670 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.541 0.541 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.541 0.180 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\test/utils.py in instrumented_test_render(95) 0.537 0.134 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\dispatch/dispatcher.py in send(149) 0.255 0.064 0.000 0.000 4
- C:\fcls\Python310\lib\site-packages\django\dispatch/dispatcher.py in (170) 0.255 0.064 0.000 0.000 4
C:\fcls\Python310\lib\site-packages\debug_toolbar\panels\templates/panel.py in _store_template_info(74) 0.255 0.064 0.000 0.000 4
- C:\fcls\Python310\lib\site-packages\django\template/base.py in render(976) 0.284 0.071 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/base.py in (977) 0.284 0.000 0.001 0.001 1
C:\fcls\Python310\lib\site-packages\django\template/base.py in render_annotated(930) 0.284 0.000 0.001 0.000 10
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.234 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.234 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.234 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.675 0.675 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.552 0.552 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.233 1.233 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.675 0.675 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.674 0.674 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.541 0.541 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.541 0.180 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.234 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.675 0.675 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.675 0.675 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.552 0.552 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.552 0.552 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 1.233 1.233 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 1.233 1.233 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 1.236 0.206 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 1.227 1.227 0.000 0.000 1

… more deleted

Okay, so the middleware deprecation check you’re seeing repeated in the stack is indeed known to be wasteful. And the good news is, I optimized it in this PR, which will be released in Django 4.1. BUT it is almost certainly not the cause of any slowdown you’re experiencing. The waste is rather minimal - about 1 microsecond per call. It also did not change from Django 3.1 to 4.0.

You’re looking at your profile sorted by cumulative time. This will show the top level function calls as taking the longest, since they accumulate the runtime of the functions below. So all this really tells you is something is slow during requests - not what. I think the right two columns that you’ve pasted are the per-call time and total itme - these are the ones to sort by to meaningfully find slow functions. As you can see for every row you’ve pasted, they are 0, i.e. less than a millisecond was spent actually in each of those functions, as opposed to a callee.

Try again with the profiling. I’m interested to find any performance regressions.

yes, that is exactly the problem with Django 4.0.1, they appeared straight after the upgarde from Django 3.9. Nothing else changed but this upgrade.

A full trace as requested, i only refreshed the page… I have not sorted anything, this is the standard way debug side panel opens… If i can or should do something different please let me know?

C:\fcls\Python310\lib\site-packages\debug_toolbar\panels/init.py in process_request(184) 0.410 0.410 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.410 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.101 0.101 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.297 0.297 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.297 0.099 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_table(99) 0.100 0.100 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_tables2/config.py in configure(33) 0.096 0.096 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.297 0.297 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.297 0.099 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\test/utils.py in instrumented_test_render(95) 0.296 0.074 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\dispatch/dispatcher.py in send(149) 0.063 0.016 0.000 0.000 4
C:\fcls\Python310\lib\site-packages\django\template/base.py in render(976) 0.238 0.059 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.101 0.101 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.297 0.297 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.297 0.099 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_table(99) 0.100 0.100 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/config.py in configure(33) 0.096 0.096 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/tables.py in paginate(563) 0.096 0.096 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core/paginator.py in page(74) 0.096 0.096 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.297 0.297 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.297 0.099 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\test/utils.py in instrumented_test_render(95) 0.296 0.074 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\dispatch/dispatcher.py in send(149) 0.063 0.016 0.000 0.000 4
- C:\fcls\Python310\lib\site-packages\django\dispatch/dispatcher.py in (170) 0.063 0.016 0.000 0.000 4
C:\fcls\Python310\lib\site-packages\debug_toolbar\panels\templates/panel.py in _store_template_info(74) 0.063 0.016 0.000 0.000 4
- C:\fcls\Python310\lib\site-packages\django\template/base.py in render(976) 0.238 0.059 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/base.py in (977) 0.238 0.000 0.001 0.001 1
C:\fcls\Python310\lib\site-packages\django\template/base.py in render_annotated(930) 0.238 0.000 0.001 0.000 10
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.101 0.101 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.297 0.297 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.297 0.099 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_table(99) 0.100 0.100 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_tables2/config.py in configure(33) 0.096 0.096 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.297 0.297 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.297 0.099 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\test/utils.py in instrumented_test_render(95) 0.296 0.074 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\dispatch/dispatcher.py in send(149) 0.063 0.016 0.000 0.000 4
C:\fcls\Python310\lib\site-packages\django\template/base.py in render(976) 0.238 0.059 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/list.py in get(141) 0.101 0.101 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_tables2/views.py in get_context_data(140) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template\backends/django.py in render(58) 0.297 0.297 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/base.py in render(170) 0.297 0.099 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in view(61) 0.101 0.101 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\views\generic/base.py in dispatch(93) 0.101 0.101 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\template/response.py in render(96) 0.308 0.308 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\template/response.py in rendered_content(72) 0.308 0.308 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27) 0.409 0.409 0.000 0.000 1
- C:\fcls\Python310\lib\site-packages\django\core\handlers/exception.py in inner(44) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\utils/deprecation.py in call(119) 0.410 0.068 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django\core\handlers/base.py in _get_response(160) 0.409 0.409 0.000 0.000 1
C:\fcls\Python310\lib\site-packages\django_otp/middleware.py in call(27)

The side panel says total time 578.79 ms but in real time i am waiting 18 seconds or so, slightly better than first fetch, some caching perhaps, but the timing and real-time do not seem to fit imho.
Hope this helps?

With a stopwatch this time, so start refresh page, start stopwatch … wait see result and hit stopwatch straight after - 23.12 seconds for Basis table - the slightly bigger one. If you want i can do it for the very small one, time it and send full trace… just let me know… don’t want to splash even more…Thanks

Did this get cut off? You may need to share it via https://dpaste.org

Hi Tim,

The first post were indeed shortened because of message size restrictions. I did post a 100% full length as answer to someone else.
It literally does only display a menu header and fetches one table with django_tables2. Nothing else.
In Django 3.9 this was like 1 to 2 seconds.
In Django 4.o this is now 23 seconds
Nothing else changed, or at least not by me.
Still same simple application.
This is for Basis table.
The Asset table is only 4 rows but exactly the same as it takes 10x longer.
I can see and tested MYSql , it’s as fast as before, 0.0009 seconds to fetch 4 rows…

Bottom line, everything works but wait times for database rendering very long.

Just to be 100% accurate, my breadcrumb and menu header pops up just as fast as before, then waiting 23 seconds and table is there.
If I get the next 25 rows waiting again, but everything else seems to work fast and well on that page…

I have been a programmer for decades but this I have no clue to why other then this Asynchronous check…

Many thanks for your time,
Rob de Vries

Verzonden vanaf mijn Galaxy

-------- Oorspronkelijk bericht --------

If you look at the last table you shared, the last row only has the first column populated. Either that’s a copy/paste error or it was cut short. If it was cut short, I’m suggesting the dpaste.org route.

Rather than using a stopwatch on the screen, look at the timing data in your browser’s developer tools on the network tab. Look to see which request(s) are consuming the most time from the browser’s perspective. It’ll give you more discrete and detailed information about what’s going on.

[Edit: Also be aware that Django Debug Toolbar itself can add significant time to the response. Your timing measurements should be made with DDT disabled.]

Hi Tim,

the only piece i missed copying was this: 0.328 0.328 0.000 0.000 1
the last timings on that row/ Side Panel has no more data than that, maxed out scroll down…
Sorry about that small missing piece.
Rob

Dear all,
It is working again! :star_struck: Not sure what it was but two things i did made it work very fast again even with Debug Toolbar on:
1: Windows 11 had an update on my virtual machine last night →

2022-02 Cumulative Update for Windows 11 for x64-based Systems (KB5010414)

2: Chrome had an update that i applied - >

Chrome is up to date
Version 98.0.4758.102 (Official Build) (64-bit)

So, either windows or chrome had an issue in my case - VERY GLAD it is most likely not Django 4.0!!
Thank you very much for your help, very nice to see such an active community actually trying to help and gave me some good tips along the way! Network tracing is very handy and will certainly use that more often!
Many thanks to all who helped! :grinning:
Best regards,
Rob
PS yes i did do a fresh restart before going online with this but that did not improved the slowness i reported - just to let you know, lol that is always the first thing to do :wink:

2 Likes