News for hackers. Stuff that matters.
Re:YouTube artificially slows down video load times when usi... by kjhgksjdfhg on Monday November 20, 2023 @05:48AM (#38346112)
I'm not even mad about Google making my artificially wait 5s for using firefox.

I'm mad that such a big company with suposelly decent engineers, are making me wait 5s with literally a sleep, how is even possible to do such thing in such a rudimentary way? I would be like damn that was smart, this feels like, seriously this is the level?

Re:YouTube artificially slows down video load times when usi... by throwaw12 on Monday November 20, 2023 @05:54AM (#38346167)
IMHO, this kind of things are not done by engineers.

    * Marketing/Sales asks engineers to add a feature flag to sleep N milliseconds for their research: "how slowing down impacts your revenue"
    * engineer adds a flag, with different control parameters
    * Some genius in Product figures this out and updates the experiment to slow down for competitors
When company gets a backlash from public: "oops, we forgot to clean up all parameters of feature flag and it accidentally impacted Firefox"
Re:YouTube artificially slows down video load times when usi... by progval on Monday November 20, 2023 @06:10AM (#38346310)
Re:YouTube artificially slows down video load times when usi... by Jensson on Monday November 20, 2023 @06:48AM (#38346686)
Google stopped testing stuff in Firefox, that is all they did afaik. We all should know how many bugs and "oppsies" you get when you don't test before releasing new features. Test code snippets being pushed to prod etc.

Engineers tend to create paper trails on what they work on, code reviews and bug logs etc are everywhere, so I doubt there is any of those where they say "Make things shit for Firefox to hurt our competitors", that would net them an easy loss in court. But not testing in browsers with small userbases will hold in court.

Re:YouTube artificially slows down video load times when usi... by progval on Monday November 20, 2023 @07:59AM (#38347325)
Firefox has a small userbase partly because of the early "oopses" described in the article I linked. Those happened a while ago, when Firefox had more users than Chrome.
Re:YouTube artificially slows down video load times when usi... by Jensson on Monday November 20, 2023 @08:11AM (#38347451)
Chrome was bigger than Firefox by 2012, the accusations that Google intentionally made things worse for Firefox came many years after that.
Re:YouTube artificially slows down video load times when usi... by toyg on Monday November 20, 2023 @09:21AM (#38348602)
But they referred to behaviour that was present pretty much from the start. It's just that Mozilla folks were extremely tolerant and assumed good faith for a very long time.

Google have been disgustingly anticompetitive for a very, very long time at this point.

Re:YouTube artificially slows down video load times when usi... by acdha on Monday November 20, 2023 @12:50PM (#38351457)
Yeah, one of the biggest examples being the HTML 5 video push and Chrome’s claims around H.264: Google promised they were going all in on WebM and would remove support soon, but never did. That meant that Firefox users got more errors outright but also that for years even sites like YouTube would leave Firefox using 100% CPU with your laptop fans on high doing software WebM while Chrome users got hardware accelerated H.264. That became moot after Mozilla and Cisco struck that deal and video hardware acceleration for other formats shipped but there was a multi-year period where Firefox suffered badly in comparison to other browsers.
Re:YouTube artificially slows down video load times when usi... by abdullahkhalids on Monday November 20, 2023 @12:47PM (#38351408)
Another person is claiming that Google writes custom code for Firefox (or other browsers) to enable tracking, because of the feature difference between Firefox and Chrome [1]. Only one of you can be correct.

[1] https://news.ycombinator.com/item?id=38347364

Re:YouTube artificially slows down video load times when usi... by shadowgovt on Monday November 20, 2023 @01:03PM (#38351694)
The company is big enough for both of them to be correct.

I have firsthand knowledge that Cloud, for instance, did not test regularly directly on Firefox. Team couldn't justify the cost of setting up and maintaining a FF test suite to satisfy 1 in 50 users, so they didn't (and nobody up-chain pushed back on that). Testing was done regularly on Chrome, Safari, and Edge, as per the usercounts and "top three browser" guidance (at the time, we didn't even test regularly on mobile, since there was a separate mobile client).

But the analytics team? I'm sure they test directly on Firefox. They're just testing an entirely different piece of the elephant and their end-to-ends won't include how, for example, changes they make interoperate with Firefox in the context of Cloud. Or YouTube. Or etc. Not unless they have a specific reason to be concerned enough to.

Google's like any other megacorp in the sense that costs of cross-team coordination are combinatoric.

Re:YouTube artificially slows down video load times when usi... by hooverd on Monday November 20, 2023 @03:22PM (#38354093)
Nah, they're totally incentivized to make sure tracking works while still having plenty of oopsies that could cause people to switch.
Re:YouTube artificially slows down video load times when usi... by goku12 on Monday November 20, 2023 @08:34AM (#38347761)
This should be a top level comment on news like this. Everyone needs to be reminded that this is neither a new behavior nor something unintentional.
Re:YouTube artificially slows down video load times when usi... by n4r9 on Monday November 20, 2023 @06:25AM (#38346458)
Very good point. It's important to recognise that developers in many companies are often not fully aware of the intended use of features they're asked to create.

Another example that springs to mind is Uber, who used a tool called "Greyball" to avoid contact between drivers and authorities: https://www.reuters.com/article/uk-uber-greyball-idUKKBN16B0...

My initial reaction was astonishment that the engineers would happily implement this. And maybe that is what happened. But the alternative possibility is that product and senior management assigned different parts of the feature to different teams e.g. one team develops a pattern recognition system to detect users' professions, another team develops a spoofing system for use in demos, etc...

Re:YouTube artificially slows down video load times when usi... by brailsafe on Monday November 20, 2023 @03:05PM (#38353777)
Why would you be surprised that they'd implement this? It's their job to implement things.
Re:YouTube artificially slows down video load times when usi... by n4r9 on Monday November 20, 2023 @04:29PM (#38355098)
They were using it to evade law enforcement while flouting regulations. It's highly unethical and almost certainly illegal.
Re:YouTube artificially slows down video load times when usi... by brailsafe on Monday November 20, 2023 @08:43PM (#38357730)
Oh I thought you were referring back to the YouTube issue
Re:YouTube artificially slows down video load times when usi... by n4r9 on Tuesday November 21, 2023 @03:09AM (#38360803)
Tbh even that is ethically very questionable, if the engineers knew that the outcome would be a delay specific to Firefox.
Re:YouTube artificially slows down video load times when usi... by lotsofpulp on Monday November 20, 2023 @05:59AM (#38346217)
> * Marketing/Sales asks engineers to add a feature flag to sleep N milliseconds for their research: "how slowing down impacts your revenue"

“Research”

Re:YouTube artificially slows down video load times when usi... by Jensson on Monday November 20, 2023 @06:34AM (#38346543)
They have done such research before, Google published this at a time when developers were all "100 ms more or less web load time doesn't matter". Since then webpages has gotten much more focused on performance.

https://blog.research.google/2009/06/speed-matters.html

Re:YouTube artificially slows down video load times when usi... by kevin_thibedeau on Monday November 20, 2023 @07:21AM (#38346955)
The dog slow load times of ad infested AMP pages would suggest otherwise.
Re:YouTube artificially slows down video load times when usi... by Jensson on Monday November 20, 2023 @07:40AM (#38347135)
The prevailing developer discussions going from "Load speed doesn't matter, stop complaining about useless stuff" to "load times matters, but here we choose to make it slow for other reasons" is a massive improvement though. Today speed is valued, it wasn't back then.
Re:YouTube artificially slows down video load times when usi... by bbarnett on Monday November 20, 2023 @08:49AM (#38347981)
Untrue. I optimized pages pre-2000, and it had always mattered.

It's always, always mattered. If anything, people care less today, with the entire ridiculous 100 loads per page.

Re:YouTube artificially slows down video load times when usi... by Jensson on Monday November 20, 2023 @11:08AM (#38349868)
Of course it always mattered. But at the time lots of people argued it didn't matter, which is why the headline is "Speed matters". You thinking it did matter at the time doesn't mean the general community thought so.
Re:YouTube artificially slows down video load times when usi... by bbarnett on Monday November 20, 2023 @01:20PM (#38352008)
But the general community did care about speed. Everyone worked towards small load times, optimized (for example) image size for optimal load time, everyone cared.

Whomever didn't care was weird.

Re:YouTube artificially slows down video load times when usi... by xxpor on Monday November 20, 2023 @01:32PM (#38352202)
AMP pages load way, way faster IME
Re:YouTube artificially slows down video load times when usi... by kevin_thibedeau on Monday November 20, 2023 @06:25PM (#38356479)
Not as fast as with 90% of JS blocked. That's how the web was supposed to work, not downloading 50 MiB on every hyperlink.
Re:YouTube artificially slows down video load times when usi... by OscarTheGrinch on Monday November 20, 2023 @06:12AM (#38346335)
Researching how best to fuck with your competitors.
Re:YouTube artificially slows down video load times when usi... by actionfromafar on Monday November 20, 2023 @06:25AM (#38346456)
Next: researching regulatory capture?
Re:YouTube artificially slows down video load times when usi... by no_wizard on Monday November 20, 2023 @07:21PM (#38357013)
This doesn’t add up.

In order for someone to slow down the by browser they need someone to have coded the following:

- UA Detection

- Branching for when the flag is on or off

- a timeout that only runs when these two things are true

That takes an engineer to do the work. Marketing and product managers are not writing this code certainly.

If they’re abusing a differ t flag, then the real question I have is what the flags purpose is and why is it screening Firefox.

Either way there is an intention of UA checking and throttling based on the UA and that takes an engineer to do it

Re:YouTube artificially slows down video load times when usi... by patchguard on Tuesday November 21, 2023 @12:53PM (#38367209)
Not so hard to believe tho. I work on a product that has parametrized feature flags. This means that, from a web interface, someone can say things like "activate feature X, on machines running operating system Y, at version Z, and are running product version W with license type Q". This is not a hard thing to build, and once you have it you can mix and match filters without being a software engineer or knowing how it works behind the scenes.
Re:YouTube artificially slows down video load times when usi... by _fizz_buzz_ on Monday November 20, 2023 @06:40AM (#38346612)
Maybe the engineer that was tasked with implementing was annoyed with the task and did it on purpose this way.
Re:YouTube artificially slows down video load times when usi... by kristopolous on Monday November 20, 2023 @06:17AM (#38346371)
Because it works.

Good engineering isn't about being obtuse and convoluted, it's about making stuff that works.

Re:YouTube artificially slows down video load times when usi... by legends2k on Monday November 20, 2023 @06:38AM (#38346587)
Using an idle timer, like window: requestIdleCallback [1], is good engineering. If anything passes that's not good engineering, it's laziness.

I'm not even a JS programmer but I know about timers, idle wait in UI programming is a common pattern. It's the attitude of mediocre engineers not bothering to lookup or learn new things.

If every OS/browser/stock market dev did what they want "because it works" we don't have a working system. We'll have systemic lags making the system sluggish and eventually unusable as more engineers follow the same mantra.

[1]: https://developer.mozilla.org/en-US/docs/Web/API/Window/requ...

Re:YouTube artificially slows down video load times when usi... by kristopolous on Monday November 20, 2023 @06:48AM (#38346685)
Nah, then it doesn't work.

"It works" is The high engineering bar and it's the hard one to hit.

Oftentimes it's replaced these days with imagined complexity, ideological conformity or some arbitrarily defined set of virtues and then you get a really complicated thing that maybe works some of the time and breaks in really hard to understand ways.

Transcompiled frameworks inside of microservices talking to DBMS adapters over virtual networks to do a "select *" from a table and then pipe things in the reverse direction to talk to a variety of services and providers with their own APIs and separate dependencies sitting in different microservices as it just shepherds a JSON string through a dozen wrapper functions on 5 docker containers to just send it back to the browser is The way things are done these days. This is the crap that passes for "proper" engineering. Like the programming version of the pre-revolutionary French Court.

A simple solution, fit for purpose, that works as intended, easy to understand, remove, debug and modify with a no-bus factor, that's the actual high end solution, not the spaghetti stacked as lasagna that is software haute couture these days.

Sometimes, in practice, the dumb solution can also be the smart one. True mastery is in what you choose Not to do.

Re:YouTube artificially slows down video load times when usi... by legends2k on Monday November 20, 2023 @10:34AM (#38349528)
I agree with the spirit of your comment; I too hate over-engineering. Choose your battles is an important step in mastery, yes, but being lazy can't be chalked up to mastery.

In this particular case I disagree with using `sleep`; using the idle timer it's not as roundabout as you put it: _Transcompiled frameworks inside of microservices talking to DBMS adapters over virtual networks_. It's a straight-forward callback, some lower-level timekeeper signals you and you do your thing: it's nowhere close to the convoluted jumping through hoops you explain.

Mastery comes with balance: putting in the optimal effort, not more, not less either. Of course, depends on what one's trying to master: job or programming. Former means do the minimum and get maximum benefits from your job/boss, latter means enjoy learning/programming and arrive at the most optimal solution (for no reason, just because you're passionate).

Re:YouTube artificially slows down video load times when usi... by asddubs on Monday November 20, 2023 @06:23AM (#38346432)
when the purpose is to abuse your monopoly to further your business interests in another area, being obtuse and convoluted to get plausible deniability is good engineering. This is just sloppy.
Re:YouTube artificially slows down video load times when usi... by lucideer on Monday November 20, 2023 @06:27AM (#38346479)
I think this is a good example of corporations being made up of people, rather than being contiguous coordinated entities as many of us sometimes think of them.

An engineer doing "good engineering" on a feature typically depends not only on them being a "good engineer" but also on them having some actual interest in implementing that feature.

Re:YouTube artificially slows down video load times when usi... by asddubs on Monday November 20, 2023 @06:30AM (#38346512)
I would imagine that in a well coordinated company engaging in this kind of thing, the order wouldn't be "slow down firefox", but something along the lines of "use XYZ feature that firefox doesn't support and then use this polyfill for FF, which happens to be slow". Something that doesn't look too incriminating during any potential discovery process, while still getting you what you want.
Re:YouTube artificially slows down video load times when usi... by kristopolous on Monday November 20, 2023 @06:35AM (#38346551)
Nah, that's got a risk profile. They could implement whatever your strategy is in the next release. You aren't going to necessarily get the longevity of the naive approach.

Plus a Firefox dev would discover that more easily as opposed to this version which they can just dismiss as some JavaScript bug on YouTube's part

Re:YouTube artificially slows down video load times when usi... by asddubs on Monday November 20, 2023 @08:07AM (#38347421)
that's the beautiful thing, you make the polyfill contingent on the browser being firefox rather than probing for the feature and then you forget to remove it once they implement the feature
Re:YouTube artificially slows down video load times when usi... by kristopolous on Monday November 20, 2023 @08:30PM (#38357612)
But why do you have to be that clever? If you're caught the consequences are the same regardless and both implementations would exhibit equivalent behavior.

The only superior approach here would be one that is consistent enough to be perceived but noisy enough to be robust to analysis.

Also it should be hidden on the server side.

Who knows, maybe there are a bunch of equivalent slow downs on the server side in the Google property space.

Given this discovery it would probably be reasonable to do some performance testing and change the user agent header string of the request.

Google docs, image search and Gmail operations would be the place to hide them.

Re:YouTube artificially slows down video load times when usi... by lucideer on Monday November 20, 2023 @09:28AM (#38348734)
That's assuming a degree of engineering competency at the product decision making level that is usually absent in companies that are structured as Google is, with pretty strong demarcations of competencies across teams.
Re:YouTube artificially slows down video load times when usi... by kristopolous on Monday November 20, 2023 @06:25AM (#38346455)
I dunno. How long has it been there without anybody noticing?

5 years? 7? Longer?

No matter how they approached it, you could demonstrate the pattern through the law of large numbers regardless. Might as well make the implementation straight forward.

Re:YouTube artificially slows down video load times when usi... by squarefoot on Monday November 20, 2023 @06:16AM (#38346366)
At least they didn't rewrite the sleep code to do crypto mining.
Re:YouTube artificially slows down video load times when usi... by agumonkey on Monday November 20, 2023 @06:31AM (#38346519)
follow the money

employees will follow orders, orders are made by people who control the money

Re:YouTube artificially slows down video load times when usi... by skupig on Monday November 20, 2023 @06:53AM (#38346734)
You're mad that they're using a function for its intended purpose?
Re:YouTube artificially slows down video load times when usi... by vsnf on Monday November 20, 2023 @07:10AM (#38346873)
Speaking as someone who only very occasionally does browser related programming, what is the supposed sin committed here by implementing it this way?
Re:YouTube artificially slows down video load times when usi... by another2another on Monday November 20, 2023 @07:17AM (#38346925)
Yep, curious to know the same thing myself.
Re:YouTube artificially slows down video load times when usi... by alias_neo on Monday November 20, 2023 @08:07AM (#38347423)
In programming in general, sleeps are generally considered....(I'm lacking the word)...distasteful?

If your code needs to wait for something, it's better done with some sort of event system or interrupt or similar; the reason being that a 5s wait is a 5s wait, but if, say the thing you're waiting for returned in 10ms, if you're using an alternative solution you can carry on immediately, not wait the remaining 4.99 seconds. Conversely, if it takes longer than 5s, who knows what happens?

Re:YouTube artificially slows down video load times when usi... by vsnf on Monday November 20, 2023 @09:29AM (#38348750)
Sure, but assuming we take it as face value that this is a straightforward attempt to force a UX-destroying delay, I don't see what makes this so terrible. It's meant to force a 5 second wait, and it does it. Problem solved.
Re:YouTube artificially slows down video load times when usi... by ascagnel_ on Monday November 20, 2023 @11:19AM (#38349987)
The 5-second wait is the issue, not the means it was obtained -- a fixed wait time either wastes the user's time (by making it take longer than necessary) or is prone to bugs (if the awaited task takes >5 seconds, then the end of the timer will likely break). The better question is _why_ a 5-second wait was necessary, and there's almost certainly a better way to handle that need without the fixed wait time.
Re:YouTube artificially slows down video load times when usi... by saynay on Monday November 20, 2023 @12:27PM (#38351063)
OPs point, I think, is that wasting the user's time is part of the point of the code. This specific code seems partially meant as a punishment of the user for using an adblocker.
Re:YouTube artificially slows down video load times when usi... by snvzz on Monday November 20, 2023 @01:41PM (#38352378)
*for using firefox instead of google's own browser.
Re:YouTube artificially slows down video load times when usi... by saynay on Monday November 20, 2023 @01:58PM (#38352676)
That's somewhat in debate, the last I saw. The initial report was it affected a user using Firefox, and it didn't when they switched useragents. Since then, there have been reports of users not seeing it in Firefox, but seeing it in other (even chromium-based) browsers. So it seems likely they are A/B testing it, but less clear if they are intentionally targeting non-Chrome browsers.

Their goal, quite clearly, is to prevent (or at least heavily discourage) adblockers. This is one attempt to detect them, and maybe in Chrome they have a different detection mechanism so it doesn't show the same behavior.

It would be a particularly foolish move on their part to push Chrome by punishing everything else right now, while they are in the middle of multiple anti-trust lawsuits. It makes me think that is unlikely to be the intent of this change.

Re:YouTube artificially slows down video load times when usi... by worik on Monday November 20, 2023 @06:59PM (#38356799)
> In programming in general, sleeps are generally considered....(I'm lacking the word)...distasteful?

Hmmm.....

In programming in general, Javascript is generally considered....(I'm savouring the word)...distasteful?

Yea, nah. I put a sleep in a Javascript/Dart bridge the other day.... We can do better, I can do better,

Re:YouTube artificially slows down video load times when usi... by brvsft on Monday November 20, 2023 @10:44AM (#38349609)
I don't know if this is what was meant, but my assumption is that it is quite brazen and crude.

But then I think of some alternative method where they send an ajax request to "sleep.google.com/?t=5" and get a response like "" after five seconds.

Re:YouTube artificially slows down video load times when usi... by meindnoch on Monday November 20, 2023 @11:53AM (#38350399)
For one, they didn't use React.
Re:YouTube artificially slows down video load times when usi... by babypuncher on Monday November 20, 2023 @12:48PM (#38351413)
they are a lazy man's solution to race conditions that does not actually solve the problem of race conditions, only makes them less likely to cause a problem at an often extreme cost to responsiveness as seen here.
Re:YouTube artificially slows down video load times when usi... by otabdeveloper4 on Monday November 20, 2023 @08:02AM (#38347366)
Google employs 30000 engineers, it's impossible for them all to be decent.
Re:YouTube artificially slows down video load times when usi... by CalRobert on Monday November 20, 2023 @09:07AM (#38348331)
I'm more mad about the complete failure of regulators to break up an obvious monopoly than I am with the engineers (though they're not saints either)
Re:YouTube artificially slows down video load times when usi... by shultays on Monday November 20, 2023 @09:17AM (#38348524)
It is not literally a sleep though, isn't setTimeout more like a creating a delayed event? (I am not a webdev)
Re:YouTube artificially slows down video load times when usi... by Izkata on Monday November 20, 2023 @09:47AM (#38349043)
You can't directly do a sleep in Javascript because it runs in the same thread as the UI - it would block the user from interacting with the page. This is effectively a sleep because after 5 seconds it's running the code in the passed-in function (not firing an event). The code in the function then resolves a promise, which runs other functions that can be specified later by what called the one using setTimeout.
Re:YouTube artificially slows down video load times when usi... by yencabulator on Monday November 20, 2023 @09:50AM (#38349070)
That's Javascript for you. Don't want to block the one thread from doing other things in the meanwhile.
Re:YouTube artificially slows down video load times when usi... by shmerl on Monday November 20, 2023 @01:06PM (#38351765)
Reminds me A Ticket to Tranai by Robert Sheckley where they deliberately asked to slow down robots in order for people to be angry and destroy them.