Are you sure about that? When I profile it in chrome, about 50% of the time is spent in the garbage collector and "(program)". Randomly pausing the debugger most hits the ad code, which I think is what is causing the problem. It seems to be constantly loading and displaying the same ad over and over again, or something dumb along those lines.
The irony is that there are only two small, mostly static adverts on the entire friggin page.
Anyway, debugging this webpage was much more interesting than the article itself :)
program is native function calls, often poorly performing animations look like this, the connection is not immediately apparent because the calling function looks like it takes a disproportionately and innocently small amount of CPU time.
Admittedly I did not check further so maybe i'm wrong, but that function is at the top of the list for the JavaScript code, if it's GC the connection is easier to establish because you can look at the objects on the heap and see if they are created by that function... if it's native canvas or webGL on the other hand I find I usually have to change the code to find the relationship... maybe there are more advanced ways, I know there is way more to chromiums dev tools that what I use.
I too pissed to dig deeper... why couldn't the site authors be bothered to properly debug some animation code that is clearly runaway.
Typinganimationframe wasnt on the list for me. Just lots of calls using small amounts of time. Its the animation thats causing the gc and program time.
Lawyers don't decline to give legal advice for free just because they want paying, although they do, and fair enough. Law is a highly complex and recondite field, and a solid answer on any but the most trivial question requires nontrivial research to identify with confidence.
Lawyers also have a professional guild to which to answer, and if they say something offhand which turns out to be erroneous in a way that brings someone to grief, their guild will not be pleased with them.
In fairness, I probably wouldn't take the time here either; on the one hand, I block ads anyway and so don't have such problems, and on the other, I tend only to do that when it's to my own direct benefit that the issue be fixed, and broken ads on a site I'll visit once ever don't meet that test - when Postmates screws up their UI and I have to stub out some analytics functions to place an order, they get an email; here, I'd just add the site to my JS blacklist, reload, read, and go on about my day.
'A highly complex and recondite field, and a solid answer on any but the most trivial question requires nontrivial research to identify with confidence.'
So very much like the problem identified here then?
Woa you only ever give paid "expert" advice? Do you also not talk to colleagues in other companies on conferences because you think a lawyer would not have that urge either? Or more generally, if you see a bike light forgotten and left on, do you not helpfully turn it off just because you wouldn't be paid when doing so?
Where is the line to be drawn? Should the line remain there for everyone even if people vary in endowment in natural ability, opportunity for experience, and access to education?
The line is drawn when you make a site, test it, notice that it runs like a pig, and then think to yourself "You know what, this is fine". There's an obvious difference between an honest mistake and just plain incompetence with a dash of lazy.
I'm all for equal opportunities and whatever, but when the bar gets set too low then we all suffer.
My point is that what qualifies as incompetence is extremely subjective. Saying "this person's work is incompetent", I think, usually amounts to nothing more than "this person made mistakes in their work that turn out to be obvious to me because of the particulars of my circumstances."
Take me for example. I work as a software developer at a company that hires devs who studied computer science or math mostly from lower-ranked ivies and big state schools. I have an idea of what constitutes good code, and most of my coworkers, owing to our common background, either share this idea or soon find their views being molded by our code review process.
When I look at what my more talented classmates are doing who work at Google or an elite startup, I am humbled and a little embarrassed to show them my code. They would consider some of the code that is written in my workplace to be the product of incompetence. When I look at what my liberal arts friends who were hired as web developers are doing at their non-tech companies with only a few months of programming training, I remind myself that I have much more experience than they do and that my response should be to help them as I am able instead of to shame them and adjust the laurels that I rest on.
And there are people better than my talented classmates at Google and Airbnb who would call their code incompetent. And still others more talented than them. Etc. And there are people who write code that is even more poor than my liberal arts friends'. And still others, ... etc.
Not only is the label of incompetence highly subjective, it is also useless at best and injurious to everyone involved at worst. The less-skilled dev learns nothing by being called a name. Giving harsh criticism from an assumed position of superiority can be gratifying in the moment. I know, I am often tempted into it myself. But it is also a missed opportunity for cultivating empathy for your fellow-human, and a missed opportunity to help someone.
> Not only is the label of incompetence highly subjective, it is also useless at best
This just isn't the case. The label of incompetence can give you correct, meaningful answers to questions like
- This person wants me to work with them. Am I likely to get anything out of this?
- If I devote my time to trying to educate/train/help this person, will I see any results from that? Will they end up with any additional knowledge/skills/gain?
- Should I copy this person's work?
- Is there any value in listening to this person's advice or recommendations?
- Can I trust this person to complete an important task for me?
I'm not sure what here gives you cause for such a cri de coeur.
It would certainly dismay me to see these attitudes taken by an educator. For a working professional with deadlines to meet, they are entirely reasonable, albeit perhaps a bit harsh. But the world can be a bit harsh, too.
If you don't understand how to write acceptable Javascript, don't use Javascript for your website. It's really not necessary for a website hosting news articles, blog posts, or other static content.
Opened the site while running NoScript in default deny mode. The text rendered, I read the article, and closed the tab, and it never maxed out my CPU at all.
Working in a cloud company all of us are pretty conscious of the cycles we consume in our architecture and the resources we consume on our client's machines. If we accidentally ran our debug code fleet-wide I'm sure we'd single-handedly bring more than a few coal peaker-plants online to handle the surge.
But our motivation is our customer's happiness and our pocketbook. For an advertiser you aren't the customer, you're the cattle.
So your adblocker is actually saving the world. One drop of oil at a time.