web - Performance costs of multiple <script> blocks in <body> -


working blog landingpage contains large list of posts , 20-30 placeholder-divs ads, each ad-div containing script tag single function call triggers ad-loading.

for example: <script>initializead('ad-1')</script>

the function doesn't take significant amount of time @ all, appends string argument array. actual loading of ads occurs asynchronously later.

now i'm tasked improving initial pageload speed , first-time-to paint, , i'm wondering is: having 30 script blocks in body have negative impact on performance?

i know browser has interrupt html-parsing , start script-evaluation encounters script block. amount of script-blocks in have negative effect? costly browser task switch html parsing script evaluation?

could improve performance moving code single script block @ end of body instead of having multiple script blocks?


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -