Half of the problem isn't even the JS itself. It's what it is used for.
Read theory, but know this is not a comprehensive work: https://idlewords.com/talks/website_obesity.htm
Most of the web today is not designed to deliver information that you request. It is designed to deliver ads, by enticing you with the promise of information. The ads are what are slowing you down.
Install a good adblocker. uBlock Origin is the generally recommended one. (I was also going to recommend uBO Extra but that seems to be unnecessary now. Rot in hell, Instart Logic!) Though I recommend more drastic measures as well.
Pi Hole allows you to set up network-wide ad blocking through a DNS blackhole system. Basically, DNS is your computer's phonebook. For the zoomers out there, we used to get a really thick book in the mail occasionally, it had people's landline phone numbers (a primitive wired form of telephone communication) in it for everyone in the local area. If you wanted to call your friend at school, you'd ask your parents to help find their parents' names (the head of household, most often the adult male parent, would be the name listed -- often your parents would know them if they've both lived there the whole time), and you'd call them and ask to speak to them (their parents would likely pick up, landline phones had one phone for the whole house). The point is, it translates the names to a number useful to the system. Pi Hole is sort of like ripping out or blacking out numbers you don't want your computer to call. You need a Raspberry Pi for this which can run you $50-80 bucks factoring in accessories you need, but it's worth it. If you're smarter than me you can probably get it to work over VPN for your phone on the go, but I have a bachelors degree in IT and couldn't figure it out (I didn't try very hard to be honest since I don't have many ads getting through regular iOS ad blocking). https://pi-hole.net/
Ad Nauseam is a nuclear option and is mutually exclusive with the above (though you can use it for desktop and PiHole for mobile devices). Ad Nauseam sacrifices performance, but will simulate clicking random ads in the background. This ruins advertisers' data, and may generate billable events (meaning the site will get paid for ad clicks, which you may or may not want, but still, it's at the expense of the advertiser). I suspect this may be the more popular option for some, but I ultimately quit using it in favor of Pi Hole. Get it here: https://adnauseam.io/
I may make an effortpost on this subject if I remember.
Half of the problem isn't even the JS itself. It's what it is used for.
Read theory, but know this is not a comprehensive work: https://idlewords.com/talks/website_obesity.htm
Most of the web today is not designed to deliver information that you request. It is designed to deliver ads, by enticing you with the promise of information. The ads are what are slowing you down.
Install a good adblocker. uBlock Origin is the generally recommended one. (I was also going to recommend uBO Extra but that seems to be unnecessary now. Rot in hell, Instart Logic!) Though I recommend more drastic measures as well.
Pi Hole allows you to set up network-wide ad blocking through a DNS blackhole system. Basically, DNS is your computer's phonebook. For the zoomers out there, we used to get a really thick book in the mail occasionally, it had people's landline phone numbers (a primitive wired form of telephone communication) in it for everyone in the local area. If you wanted to call your friend at school, you'd ask your parents to help find their parents' names (the head of household, most often the adult male parent, would be the name listed -- often your parents would know them if they've both lived there the whole time), and you'd call them and ask to speak to them (their parents would likely pick up, landline phones had one phone for the whole house). The point is, it translates the names to a number useful to the system. Pi Hole is sort of like ripping out or blacking out numbers you don't want your computer to call. You need a Raspberry Pi for this which can run you $50-80 bucks factoring in accessories you need, but it's worth it. If you're smarter than me you can probably get it to work over VPN for your phone on the go, but I have a bachelors degree in IT and couldn't figure it out (I didn't try very hard to be honest since I don't have many ads getting through regular iOS ad blocking). https://pi-hole.net/
Ad Nauseam is a nuclear option and is mutually exclusive with the above (though you can use it for desktop and PiHole for mobile devices). Ad Nauseam sacrifices performance, but will simulate clicking random ads in the background. This ruins advertisers' data, and may generate billable events (meaning the site will get paid for ad clicks, which you may or may not want, but still, it's at the expense of the advertiser). I suspect this may be the more popular option for some, but I ultimately quit using it in favor of Pi Hole. Get it here: https://adnauseam.io/
I may make an effortpost on this subject if I remember.
Please do make the effort post if you have the time, this is interesting and useful.