10 ms·
All 1,400 Google Chrome CLI flags
- sigmonsays 4y agoat some point you gotta start engineering a solution instead of just adding to the list of flags.. isn't that what engineers are supposed to do? Seems like they got themselves into a tech debt situation now
- version_five 4y agoI was just thinking that in my own code I have a tendency to add more command line arguments as a quick fix and then (hopefully) go back and limit them to what is essential and add config files if necessary, etc. It does seem like a sign that too many people are able to come in and do some debugging or experiment via flags, without cleaning up afterwards.
- cpncrunch 4y agoWell it's either flags, or a config file (firefox's user.js). Just two different ways of achieving the same thing. Browsers are complex these days, and it's good that we have options to change behaviour that is problematic for us. I run chrome/firefox as part of a batch job on a virtual linux display, so I really need to turn off all the crap like first-start wizards, bookmarks and the like.
- zefix 4y ago> Well it's either flags, or a config file Actually: No. Well, at least not in the ridiculous way that Chrome or Firefox do it. Command line options or config files are both fine - when used in moderation. The problem here (at least in part) is that it is extremely easy for devs to just add a configuration option. But it is much harder to think about whether a user would actually ever want to change the setting, if it had a good default value. In fact, I think maybe about 20 command line options would cover 99.9% of all usecases for chrome. - And it would be so much more understandable. - Both for the actual developers and the users. I absolutely despise it when a software product pushes effort downstream this way. --- Note: I fully understand that in Chrome these flags at least partially leak out of their "trunk-driven development". - But this is no excuse: In no way should the development environment leak out into a released product this way! - And it would be exceptionally easy to stop this too: Just disable all development flags in the release build.
- drpixie 4y agoYeah - my first thought, on seeing the list, "the project is completely out of control and it's amazing that it works as well as it does!" I guess it's a tribute to what you can get if you throw enough money and effort at something! They must be running flat-out just keeping the project going and the ever-changing product running. Just imagine what they could have done with that money & effort, if it was spent on clear, focused projects.
- jeffbee 4y agoIf you see evidence like this that conflicts with your prejudices, it should make you rethink your prejudices, not denounce the evidence. Facts we are aware of: Chrome is an extremely successful project with many users and developers, and it uses flag-oriented feature control. Your prejudice: flag-oriented feature switches are "out of control". Now, how are you going to reconcile this? Doesn't it call into question the utility of your prejudice? This is demonstrably an extremely successful project that ignores your rule.
- drpixie 4y agoI've been around enough projects to pick up on warning signs :) That google has been able to manage such a project is truly impressive. Chrome is clearly the most popular browser out there but, for me, popularity counts for little. Chrome is also extremely heavyweight by most measures (installed size, memory usage, cpu usage, build time!) Re popularity: Imagine you're at a retail store buying a coffee maker. They tell you "this model is very popular". For something that people purchase/install occasionally, popularity isn't a good indicator of quality, though it might be a good indicator of price, advertising, feature-list, or sales commission! Personally, I want my coffee maker to make great coffee, and to keep doing that for a long time. And I want my browser to be fast, lightweight, and minimally intrusive.
- joshuamorton 4y agoThe "it uses lots of memory" argument is sort of silly. That's the behavior you want. Unused ram is wasted, as long as chrome is willing to play nice and free it, using otherwise unused memory to prefetch/cache is good user experience.
- btown 4y agoCounterpoint: well-designed feature flags encourage good design and modularity. Rather than sneaking my hacks all over the codebase, if I’m going to sneak a non-backwards compatible change somewhere, I’ll need to explicitly put it behind my feature flag, and it’s immediately apparent not only to reviewers but also future maintainers that my feature is the one that changed behavior. It’s also documentation: this is why this change is necessary. And removing a flag, even when the feature is stable, removes those guardrails.
- missblit 4y agoCounter counterpoint: Chrome also has an entire system for gating features behind flags without needing to write a new command line flag for each one. Counter counter counterpoint: I like command line flags and you can take them from my cold dead hands.
- btown 4y agoIf it doesn't hail from the command line flag region of France, can it really be called a feature, or is it just sparkling technical debt?
- Wowfunhappy 4y agoWhat is the alternative? Make them compile-time options? Expose them to the UI? For all sorts of testing reasons, there has to be a way to disable the JIT. There has to be a way to disable sandboxing. There has to be a way to bypass the GPU acceleration blacklist, and there has to be a way to launch without GPU acceleration on non-blacklisted hardware. Thank god the options exist! I mostly wish the documentation was better. It would be great if I could filter by platform. And, um, the definitive source probably shouldn't be some guy's personal website.
- zefix 4y agoThe alternative is to not have (most of them) at all. The reality is that 99.5% of users have perhaps 10 or 20 actual usecases/requrements. - You named a few of the most prominent ones. These need to be supported (e.g. with flags) and documented properly. Everything else is excess can be removed. The problem with this is: You need to find out what users want to do. But many software projects are just too lazy and push all the effort downstream.
- gleenn 4y agoThat is a crazy amount of flags. I wonder how many conflict with each other too
- bhawks 4y agoInternally all Google apps have mind bending numbers of command line flags. I believe this drove kernel patches to increase the size of the command line. Yes flag hygiene is a bit of a problem too :)
- jamesfinlayson 4y agoI remember someone telling me about a requested feature in Chrome that got rejected because it would create "yet another option" that would need to be tested etc.
- the-rc 4y agoThat was something else. Most command line flags were untouched from the defaults. What was a problem was GFE's command line. For a number of reasons, it had to list every public service and its config. There were many hundreds of those, probably thousands by now. And there was a kernel limit of 128KB, which was kept at bay for a while with tricks (hacks?), until eventually a proper solution was implemented.
- jeffbee 4y agoHacks such as: the ability to unpack the command line from a single compressed and base64-encoded arg. Fun fact about Linux's now-unlimited, demand-paged argv: the JVM was a bit behind the ball on that one. As soon as Linux systems with enormous args limits appeared, `xargs` happily adapted. But the JVM at that time had quadratic command line parsing. So anyone using `xargs java` suddenly had cron jobs (or whatever) that never finished.
- dagmx 4y agoAt that point, why not just use them as a library and call them as an API from bespoke command line tools?
- xyst 4y agojust one more flag, bro. That will be the last one
- tapoxi 4y agoIs Firefox this complicated?
- eclipticplane 4y agoFirefox has a boatload of things available in about:config.
- OJFord 4y agoSo does Chrome though. Can't speak to the overlap with flags. If a large part of it's just exposing all that then I suppose that's good... But wouldn't you just have it be the same key:value pair as on that page, behind a single flag?
- zamadatix 4y agoChrome doesn't have an about:config. There is about:flags (redirects to chrome://flags/) but that intentionally doesn't list all of these.
- Ayesh 4y agoI doubt it. Having used Firefox for over a decade, I never had to use flags other than a profile selection option and a safe mode flag. I have come across more flags during my occasional use of Chrome. Firefox's configuration flags are unified in `about:config` page. It has a whole bunch of configurations too, but they are neatly named (e.g `browser.ui.something.enabled`) and I prefer configuration options than flags.
- Grimburger 4y agoIf you want to stop the inevitable new chrome 0-days: --js-flags="--jitless" Blows my mind you can't turn off JIT in the config. It's a searchable setting in Firefox and on by default in Edge's Super Duper Secure mode.
- dataflow 4y agoHow do you set that to run on auto-run when the OS starts? Or in general, when Chrome is launched in some other way than you typing that on the command-line?
- tacotime 4y agoAt least on Windows, you should be able to modify the target property of the program’s shortcut to add any desired flags. Then use that shortcut to launch, or drop it in the startup folder. On Linux idk, maybe an alias?
- dataflow 4y agoWhat shortcut though? Auto-launch is automatically set by Chrome in the registry, and Chrome really doesn't like you to mess with things it manages in general, and would eventually overwrite this in any case. Also I _think_ messing with shortcuts sometimes has weird effects with Chrome, like on taskbar grouping, though it's been a while since I've tried.
- HideousKojima 4y agoIn Windows, at least, you can make a batch file to launch Chrome with that option, and then use a shortcut to that batch file to open Chrome.
- OkayPhysicist 4y agoYou can skip the batch file and just include the flag in the shortcut.
- ravenstine 4y ago
- ivraatiems 4y agoSome of these, like "--memlog", that have no description seem pretty clear about what they do. Some, like "--zygote", have no description and also are totally unclear. Love it.
- deleted 4y ago[deleted]
- missblit 4y agoThe word "Zygote" will actually be really clear to anyone who's been exposed to Chrome's multiprocess architecture. https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux/zygote.md https://chromium.googlesource.com/chromium/src/+/HEAD/docs/l... > A zygote process is one that listens for spawn requests from a main process and forks itself in response. Generally they are used because forking a process after some expensive setup has been performed can save time and share extra memory pages. With that background, --zygote isn't actually a flag at all. If you click on it it takes you to a string constant, but that string is actually a value for the --type flag. e.g. anzygote process would have `--type=zygote`. `--type` is itself an internal flag, explaining it's lax description of "Flags spied upon from other layers.". However it is briefly described in the documentation I linked above.
- ivraatiems 4y agoFascinating -- thank you!
- zimbatm 4y agobazel is also pretty good with the number of flags. I didn't count them but there are quite a few of them: https://bazel.build/reference/command-line-reference https://bazel.build/reference/command-line-reference is this part of the Google culture?
- nosefrog 4y agoYea, a lot of the core libraries at Google have flags in them, so when you link them into your cli, you get those flags as well.
- erik_seaberg 4y agoThey once submitted a patch to raise the Linux kernel’s limit on process command lines, because 128 KB was no longer enough for all their flags.
- boywitharupee 4y agois there a source for this patch?
- jeffbee 4y agohttps://github.com/torvalds/linux/commit/b6a2fea39318e43fee84fa7b0b90d68bed92d2ba https://github.com/torvalds/linux/commit/b6a2fea39318e43fee8...
- bhawks 4y agoI am not a global variable sir, I am a command line flag.
- loeg 4y ago"gflags:" https://gflags.github.io/gflags/ https://gflags.github.io/gflags/
- robohydrate 4y ago
- jacquesm 4y agoThink about the number of ways in which these can be combined and the kind of headache that would cause during testing. Maybe they would benefit from a project aimed at reducing this to a more manageable list?
- mihaitodor 4y agoFunny to see that some of them use `_`s instead of `-`s as the separator character.
- compiler-guy 4y agoThe underscore is the preferred method for naming flags inside Google.
- drjasonharrison 4y agoit also simplifies the search for the flag in the source code. Rather than having to switch between `-` and `_`, you have only one textual representation for the flag. I personally like to use `-` in filenames and flag names because it's one less shift key to press. But it leads to the requirement to translate the `-` into `_` in the code. Eg, `resource-filename.json` becomes something like `resource_filename` in the code.
- vinkelhake 4y agoNote that a decent amount of these are ChromeOS specific. The whole visual UI is orchestrated by the "chrome" binary.
- btgeekboy 4y agoSo Chrome's not just a browser but a window manager too?
- joecool1029 4y agoYeah, that was kind of the point of them moving to Aura. More details on it: https://www.chromium.org/developers/design-documents/aura-desktop-window-manager/ https://www.chromium.org/developers/design-documents/aura-de...
- seanp2k2 4y agoBrowsers are de-facto windows managers in the unfortunate world we've created where everything is a webapp with 5% of the perf that it'd have as a native app.
- jancsika 4y agoEverything-as-a-web-app is not good. However... I didn't measure it, but switching tabs in an Asus C201 Chromebook sure seemed to have a much lower latency than tab switching (or clicking on a different app in a menubar) for any Linux distro I've ever used on any piece of hardware. That includes this Dell XPS laptop running Ubuntu, which is fast and well-supported with firmware. I speculate without measuring because switching browser tabs on that Chromebook feels uncanny. It's as if there's some ahead-of-time trick that utilizes the camera to guess my impending trackpad click or keystroke. That makes me think I've gotten used to a fairly high floor of latency on my Linux machines. Add to that the long battery life while browsing in Chrome. Add to that the fact that I open and close that Chromebook at will with the browser in nearly any state, and it never got hot, crashed, or failed to come back up when I reopened it[1]. Those things being true, it makes more sense from a performance standpoint to use Linux from within Chrome than the other way around. That is-- as long as you spend non-trivial time in a browser, it's more efficient to do Linux-Inside-Chrome than Chrome-Running-Inside-Linux. (And I have never found a Linux Firefox config on any piece of hardware that can reliably play videos on Reddit, which makes me think it's not handling video acceleration properly.) 1: The one exception: when I was running a low-latency audio app on that Chromebook which grabbed exclusive control of ALSA.
- insane_dreamer 4y agoflag creep
- lazide 4y agoThe number of flags in a typical internal google binary can easily be 1 or even 2 orders of magnitude higher.
- ninkendo 4y agoDidn’t Google have to patch their kernel to increase the maximum length of command line arguments, because the number of flags they actually use is so high?
- closeparen 4y agoWhy would you do this vs. having config files?
- segmondy 4y agoscripting/automation
- closeparen 4y agoI don't follow, is it easier to automate a ton of args than to automate a config file? Or better yet, put the config file in the bundle you're distributing, since it probably benefits from the same change management flow?
- hamandcheese 4y ago> I don't follow, is it easier to automate a ton of args than to automate a config file? Yes? With just flags, the only artifact that you depend on is the program. With a config file, now there is a separate artifact to maintain for every distinct configuration, which could be a lot. I'm not saying its not solvable, but it does strike me as more complicated.
- closeparen 4y agoI guess if you're distributing standalone binaries, that makes sense. The distribution systems I have seen are all tarballs, packages, or container images, where one more file is no problem. There must be some kind of config system where the flags are being driven from though, unless someone is manually typing them out each time.
- russellbeattie 4y agoI tried messing with these flags a month or so ago to see how close one could get to creating a standalone web app without needing to use Electron or similar. I assume the binary executable that a PWA installs is essentially just setting these flags on startup, so I decided to try to figure out which ones. As someone else stated, most of the app oriented flags are ChromeOS specific, so I didn't have much success. I tried a lot of different combos and scrolled through Chromium's .h headers to see what I could find. It was a good way to waste an afternoon and learn a bit more about the browser. Kiosk modes, dummy profiles, full screen, single window, security flags, etc. Lots of interesting features you don't run across regularly.
- terinjokes 4y agoIf you create a PWA on Linux all it does is drop a new ".desktop" file in `$XDG_DATA_HOME/applications`, which you can then inspect to see what flags it sets. I imagine it's mostly the same flags as used on other platforms.
- russellbeattie 4y agoOh, wow. Thanks! I will totally look at that!! I was even trying to look for strings within the Mac binary, and browsing around the repo for the PWA creation code (which I didn't find). I'm super curious what's in the .desktop file. I'm definitely going to check that out this evening.
- russellbeattie 4y agoTurns out it just calls Chromium and passes an app id: [Desktop Action Edit] Name=Edit Exec=/usr/lib/chromium-browser/chrome --profile-directory=Default --app-id=idjenohckefppahppaeclfgpbfkfppaf --app-launch-url-for-shortcuts-menu-item=https://www.hypertext.plus/editor/
- modeless 4y agoThis may sound like an insane number. But as a Chrome developer, the number of flags was never an issue for me. You don't need to test every permutation of flags because almost all of them are unsupported, best-effort kinds of things with a very small scope. You only need to test the default configuration. Compared to the other sources of complexity in Chrome (primarily portability, sandboxing, backwards compatibility, and the sheer scope of the provided APIs), flags are nothing.
- summerlight 4y agoThis is right, in many cases flags are supposed to control specific launches ("flag-flip") or being a developer shortcut rather than giving users meaningful choices.
- medellin 4y agoSounds like they forgot to cleanup after themselves
- deleted 4y ago[deleted]
- gipp 4y agoIt's largely an artifact of trunk-driven development. Everything is behind a feature flag. The benefits of this approach vastly outweigh the drawbacks IMO, but one of those drawbacks is that you tend to end up with large numbers of dead codepaths behind forgotten flags, because cleaning up old flags becomes a multi-stage process, with no incentive to follow through but your team's "standard" processes (that probably nobody's checking on) and your own desire to keep things tidy.
- summerlight 4y agoOr there might be hundreds of on-going genuine launches/experiments. There are literally thousands of engineers in the Chrome org and each launch usually takes several quarters thanks to the nature of being a customer facing platform.
- narag 4y agoA friend used to call this kind of setup flag-oriented programming. I've suffered it when working for engineering companies where the PMs understood the logic but didn't understand why it's a bad idea to just create branches for everything. Not sure why programmers would inflict this "methodology" on themselves. And no, sorry, I'm not going to read the article. Too soon.
- kristopolous 4y agoIt's great to test/disable features. Most people never need them but it saves a recompile when you do
- narag 4y agoOh, for testing we used other tricks, config files or the more modern instrumentation. The flags that I dislike are the ones used to add functionality as an afterthought.
- jbverschoor 4y agoflop, seems right
- narag 4y agoIndeed, good catch.
- UncleMeat 4y agoActual research has demonstrated that trunk based development works well. Flags are a downside, but there are enormous upsides.
- mauvehaus 4y agoFrom man cdrecord: Bugs Cdrecord has even more options than ls. Chrome puts cdrecord to shame.
- sacnoradhq 4y agonetworksetup enters the chat
- summerlight 4y ago1400 seems high until you see all the internal experiment flags. The configuration is literally several megabytes of configuration code that generates tens of megabytes of configuration protobuf message.
- sacnoradhq 4y agoSpeaking of Chrome: There was a recent Chrome on macOS beachballing problem related to dragging a tab. Multiple users noticed it at MAANG megacorp. Resolution: Running from the CLI changed some state that eliminated it, so logging in verbose mode was impossible. Instead, a SWE sent a spindump over to Chromium attached to an opened issue.
- jasonhansel 4y agoThis makes about:config look elegant.
- AlbertCory 4y agoSince I was at Google 12 years, this doesn't surprise me at all. It's not that there are 1,400 flags in ONE module; it's that all the many systems it includes all have their own. No one looks over that list and says, "Hmm, which of these 1,400 do I need today?" There's absolutely no reward for scouring the system and getting rid of the 90% of the flags that serve no purpose anymore. All you would do is annoy people and risk breaking something. So no one does it. In fact, as I recall, you could either "list the flags" for a system, or "list all the flags AND all the included systems' flags." Hardly anyone wants to do the latter.
- omoikane 4y agoThere is some incentive to clean up flags since there has been horror stories about dead flags causing problems[1]. I seem to recall there is some automation that proposes changes to remove flags that has not been set to non-default values for a sufficiently long time, but maybe that's not done for binaries that run outside of Google's network. [1] Knight Capital's $440 million glitch: https://news.ycombinator.com/item?id=31239033 https://news.ycombinator.com/item?id=31239033 https://news.ycombinator.com/item?id=4329101 https://news.ycombinator.com/item?id=4329101
- vlovich123 4y agoThat doesn’t really apply to software like Chrome modulo backup / restore accidentally confused but the risk of that depends on how that’s implemented (feels unlikely).
- amazon_illegal 4y ago[dead]
- kristopolous 4y agoI've used this page many times. Pretty useful. It's a hierarchy and pretty well organized.
- preordained 4y agoThese Googler comments crack me up. "It may seem like this is out of control, etc., but for Google/my team..." That's just straight cruft, whether you are at Google or Billy Joe Bob's software shop.
- eyelidlessness 4y agoI don’t know, engineers default to griping about their experience with mundane things much less extraordinary ones. I find so little griping about something seemingly extraordinary pretty persuasive. That’s bolstered by the fact that unlike, say, curl or ffmpeg, even as an engineer myself using Chrome constantly I’ve almost never had to care about a single one of its flags.
- lopatin 4y agoOk there's some cruft there, but if you remove the cruft, you'll still be left with, say, 700 flags, which a lot. So the point is that it's basically ok to have a lot of flags.
- swellguy 4y agoMy guess is the people who thought this was interesting, rather than just a source of reference, have never configured their own Linux installation. Sigh.
- super256 4y ago--0 No description --1 No description --10000 No description --100000 No description --1000000 No description --2 No description --3d-display-mode[1] No description --4 No description --50000 No description --500000 No description --5000000 No description --7 No description --? Lol.
- haliskerbas 4y agoPR reviews on that team must go smoothly
- naeioi 4y agoMany of these flags are not intended to be used on their own. For example, you can use "./chrome --memlog-sampling-rate=10000" but not "./chrome --10000". This information is, understandably, not explicitly stated on this page.
- seba_dos1 4y agoThere's only a single flag in `--memlog-sampling-rate=10000` though.
- fao_ 4y agoThe docs say, uh, the exact opposite though. --10000 is a single flag --memlog-sampling-rate=10000 is uh, well, also a single flag according to these docs both flags should be valid?
- naeioi 4y agoAFAIK, only "--memlog-sampling-rate=10000" is valid. Neither standalone "--10000" nor "--memlog-sampling-rate --10000" is valid. See the comment https://source.chromium.org/chromium/chromium/src/+/main:base/command_line.h;drc=f2c7cb73a687b6a23ca5223548952bc8c5766769;l=8 https://source.chromium.org/chromium/chromium/src/+/main:bas... Also see how the flag is actually parsed: https://source.chromium.org/chromium/chromium/src/+/main:components/services/heap_profiling/public/cpp/settings.cc;drc=3decef66bc4c08b142a19db9628e9efe68973e64;l=91 https://source.chromium.org/chromium/chromium/src/+/main:com...
- firatsarlar 4y agoWhat we need is, organized flags into meaningful -standardized- taxonomy.
- Uptrenda 4y agoI think this more reflects the complexity of emerging web technologies than Chrome-specific bloat. I think many people would be surprised by the sheer number of new web tech that's been added or is on the horizon. Check out some of the stuff here for an example: https://chromestatus.com/features https://chromestatus.com/features Web browsers today are more like operating systems than basic document viewers. It really is crazy what a web browser can do now. Eventually all native APIs will be web-based and all software will run in / on a web page.
- wfh 4y agoCan't wait for hacker news to find out about --enable-features and --disable-features.
- sigsergv 4y agoAnd that list is not complete, I use at lease two additional switches in development instance of chrome: --ignore-certificate-errors --ignore-ssl-errors
- cachvico 4y agoThis is expected because it's their flag-ship product.
- krick 4y agoI cannot believe I'm upvoting this...
- zulu-inuoe 4y agoI hate you
- diimdeep 4y agoHere is some critique why this is awful in context of bazillion cli options in compilers. [0] [0] Programming Language Q&A, December 2022 - Jonathan Blow https://youtu.be/OAIqCpqszVw?t=3974 https://youtu.be/OAIqCpqszVw?t=3974
- huksley 4y agoMost important flag: Which one gives you ability to run chrome without browser profile being connected to Google account in the browser session?
- quickthrower2 4y agoflagrant!
- KomoD 4y agoNow, the real question is, what happens if you run chrome with all of them!
- deafpolygon 4y agoand none to disable their telemetry, spying or tracking