It has come to my attention that the modals in Bootstrap show slower as the page's content increases.
When the page is empty, it only takes less than 100ms to show. However, the time it takes significantly increases as more content is added to the page.
I am puzzled by this connection. Can someone clarify why this behavior occurs and offer a solution to speed up the appearance of modals regardless of the page's size?
UPDATE: To see this for yourself, you can visit i.e here and run the command
console.time("modalTime"); $("#exampleModal").modal("show"); console.timeEnd("modalTime");
in the console to observe the duration. Then, add more content to the page using DOM manipulation, and run the command again.
My findings: modalTime : 70 ms
on the original page. modalTime : 1208 ms
after increasing the page's content tenfold.