7 ms·
But user-agent parsing should be blazing fast, a one-liner regexp or similar, isn't it?
by ainiriand 10y ago
But user-agent parsing should be blazing fast, a one-liner regexp or similar, isn't it?
- Eldt 10y agoThat was sarcasm
- mijoharas 10y agoI don't think so, I think the person was utilising Hanlons razor[0]: Never attribute to malice that which is adequately explained by stupidity [0] https://en.wikipedia.org/wiki/Hanlon's_razor https://en.wikipedia.org/wiki/Hanlon's_razor
- deleted 10y ago[deleted]
- marcosdumay 10y agoGotta create a good name for the "never attribute to stupidity something that makes the perpetrator rich" maxim.
- dsr_ 10y agoYes, I intended it as sarcasm.
- ohitsdom 10y agoThe user-agent parsing is fast, it's the server-side rendering logic specific to Linux user-agents that is somehow terribly slow.
- soundwave106 10y agoAnecdotal experience... but when I use Chrome and switch user agents to a random one that probably wouldn't be too common (in my case, Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36), in Chrome Network tools it seems that there were several Javascript pages that were being loaded through a "StaticLoad.aspx" (namely WordEditor.js and Hermes.js scripts), that simply hung while downloading. Changing the version didn't seem to matter (I couldn't find the latest one for any Linux style OS easily, but I tried "Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36" with the same results). However, Android type user agent strings like "Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19" load fine. Not knowing the code I have no idea what this could mean, but I suspect you're 100% right here, there's some server side rendering that does different things based on user agents, and it's having trouble on the "other UA" category for some reason.
- rhizome 10y agoIt seems something more like: case @useragent when 'Windows' send file fast when 'OSX' send file fast else sleep 3600
- Rantenki 10y agoMore likely something like: resolve_renderer_module(user_agent.os) where the osx/Windows ones are already loaded in RAM, but it has to try (and fail) to load the linux one every time somebody tries. This is classic Hanlon's razor stuff.
- cname 10y agoIs it possible that companies, teams within companies, and/or individuals might exploit "Hanlon's Razor" to their own benefit? It's easy to say "Oh, whoops" and often there's no easy way to prove incompetence vs malice. And because people are aware of this cliche/meme, they may be more susceptible to it. I wonder if people said "Hanlon's Razor" when they first heard about the VW emissions scandal. NOTE: I'm just thinking out loud here. I don't have any particular bias against Microsoft.
- jdmichal 10y ago> I wonder if people said "Hanlon's Razor" when they first heard about the VW emissions scandal. I don't think that was possible, because the engine specifically performed [0] better during the test and worse during normal operations. So what would Hanlon's Razor be? Whoops, the testing procedure accidentally happened to make our engine perform better? [0] With the definition of performance being emissions output, not power or torque.
- metaphorm 10y agoyes, but the hypothesised cause is an unhandled exception when it doesn't find a UA string from its list of expected UA strings, and that case might just hang until a timeout of some kind.