Your laptop may be causing your Retool app to start up and run slowly

An app taking a long time to start up or an app generally running slow is often caused by low a performance score (see Debug -> Performance on the bottom right of your app), low network speed, or CPU/memory restrictions of your laptop/computer.

The following will help you find out if the latter is the issue:
Time to First Query (TTFQ) is the time from when the app is opened to when the first query is run. This can be affected by app size, number of plugins, and complexity of custom Javascript (more context here).

An emtpy Retool app should load in less than a second - you can see your TTFQ of an empty app by opening the DevTools -> Console and opening the app:


You can find out the TTFQ for the app you see running slow (not the empty app)

  1. Find out what the expected TTFQ for this app should be. To determine this you will need
    a) Average TTFQ(ms) - Open browser dev console and refresh the page a few times and calculate the average of all TTFQ values to get the most accurate number.
    b) Number of plugins - Determine the number of plugins of your app by opening the debug modal on the bottom right of your app in edit mode - click on the performance tab and you'll find the page size, which represents plugins. Plugins represent the components/queries and dependencies in your app - For empty apps this will usually be 2.
    c) CPU capability - Google “ geekbench” - click through to geekbench to see your single core CPU model score. Calculate your CPU model score/2000. Decent modern cpu would be 1x whereas the most powerful machine on the market might be 1.25x and a low end chromebook could be 0.25.
    We have recommendations here for using an i5 or better. We would recommend the CPU that has over 2000 score on geekbench

  2. Then run the following calculation with your findings
    image

If the Actual TTFQ <=2 of the Expected TTFQ then the machine specs will be driving latency

Example:
For a 100 plugin app, it can't really be any faster than about: 1000ms + (100 p plugins * 10ms)/1 CPU capability = 2s.

It probably won't get any faster than that unless you have a higher end machine

5 Likes