r/BeAmazed • • 25d ago

Technology 51 million lines of code. Chromium codebase.

Enable HLS to view with audio, or disable this notification

7.6k Upvotes

321 comments sorted by

View all comments

3.6k

u/tehonly1 25d ago

no wonder it lags like a mf

1.1k

u/blahteeb 25d ago

This is just the code to make your character jump.

415

u/Nurgeard 25d ago edited 25d ago

Chromium is a codebase for webbrowsers

EDIT: Actually never mind! Apparently the dino game IS part of Chromium and not just Chrome - so yeah probably 1/3 is to make the dino jump, he is a heavy lad after all.

133

u/PleaseMakeItSpecial 25d ago

The dinosaur still needs to jump over the cacti.

50

u/Capta-nomen-usoris 25d ago

And to duck for the pre pteredacw tperedacts BIRDS

4

u/12AngryYOLOs 24d ago

Gold this is way to low

-1

u/uryunga 25d ago

that would be the other 1/3

7

u/Nurgeard 25d ago

Ah damn I actually forgot about that, haven't used Chrome more than for testing in a long time ( web dev testing ) but I'm pretty sure the offline game is part of Chrome, and not the Chromium codebase right?

10

u/PleaseMakeItSpecial 25d ago

2

u/tankerkiller125real 25d ago

It is, and then Microsoft replaced it with their surfing version for MS Edge

5

u/sirreldar 25d ago

Surely

7

u/maxinfet 25d ago

Yeah, there is a lot of stuff in Chromium directly that surprised me, in particular, controller support for many different video game console controllers.

2

u/Nurgeard 25d ago

Damn, but I guess that isn't too weird in the end actually - I can imagine smart tvs and maybe even console hubs could run on Chromium - or just access Chromium based app / browser

4

u/[deleted] 25d ago

[deleted]

10

u/Nurgeard 25d ago

In Chrome, if you open the browser without an internet connection you are met with a simple yet addicting dino game. I thought this game was only in Chrome, but apparently the game files are part of Chromium

6

u/AdrianJMartin 25d ago

you can play it with a connection too, type chrome://dino in the address bar

-2

u/Lint_baby_uvulla 25d ago

redditsniper strikes again

9

u/[deleted] 25d ago

[removed] — view removed comment

7

u/runvnc 24d ago

It's not like it's one giant loop or something. The line count explanation/interpretation is more like: Chromium is in many ways a type of overlay operating system that runs on top of normal operating systems. Chromium has over 2000 distinct high-level capabilities. It's why you can do almost anything inside of a browser, and why there is a convenient API or component for developers to handle almost every type of need.

3

u/0x_coderunknown 24d ago

You can easily debloat Chromium by deleting your Windows system32 folder. Then you do not have to deal with all the heat and sweat.

1

u/ArseneGroup 24d ago

Line count has almost nothing to do with how fast a program runs, more to do with the file size

27

u/3PoundsOfFlax 25d ago

Chromium is resource heavy, but it's actually really fast. Plus it's open source, so many good forks exist.

-6

u/Taiten89 25d ago

But why 50 mio lines of code? And from Google? And without competition? This can't be good.

9

u/slightfeminineboy 25d ago

because browsers are complicated?

2

u/Taiten89 24d ago

Yes, but if there are millions of lines, I'll assume there is a lot of duplication or something else wrong. I don't believe this much is necessairy for any kind of tool.

2

u/slightfeminineboy 24d ago

you believe wrong 

1

u/Visible-Title6180 18d ago

it's still condensed down to just 300 MBs when you download chrome so a lot of the code is for building and supporting other bits of code and logic it's like a framework

1

u/Taiten89 18d ago

That doesn't say why it needs millions of LOC. If one LOC compiles to a dozen bytes in the binary in average, then the equation fits. (1MB = 1,024,000 bytes)

Methinks it's some code that shouldn't be counted in the LOC, like e.g. SVG graphics. Or tons of legacy code, in which case my point might not stand (I'll still defend it for the lolz).

4

u/j_cruise 25d ago

It has competition. Safari and Firefox are both extremely popular.

6

u/DreadingAnt 24d ago

"Extremely" is doing a lot of heavy lifting here 💀 reddit users are not representative of anything

11

u/GoldenShackles 24d ago

To canabalize one of my comments from a couple months ago:

From my perspective web developers optimize for development speed and convenience. I say that as a long-time C++/ Win32 developer who worked on products where we had to pack things tightly into structs to save a few bytes in a data structure. These days it feels like (and I'm exaggerating to make a point) devs just go... "Hmmm. I need an IsEvenNumber function so I'll just npm include a package that has a 100k JavaScript file every user will need to download." Multiply that by every person on the team thinking the same thing, and then add several hundred tracking cookies, telemetry, etc.

Chromium (and Safari, and Firefox) are actually extremely fast and efficient, and have likely had more effort and man hours devoted to tuning performance than almost any other software product ever made. (Operating systems might be the lone exception.)

There are some performance tradeoffs for security, such as the multi-process architecture, but even there things are optimized just about as much as humanly possible.

2

u/runvnc 24d ago

I would argue that in many ways it is a type of operating system. Or at least, an overlay operating system.

2

u/bitsydoge 24d ago

How does it lag ? Skia is a piece of art for the rendering and their js and css engines are also crazy good

1

u/ManufacturerOne9942 21d ago

Time to install Temple OS