win32ss / supermium

Chromium fork for Windows XP/2003 and up
https://win32subsystem.live/supermium/
BSD 3-Clause "New" or "Revised" License
2.22k stars 74 forks source link

Decrease chrome.dll size (divide in to half parties) #259

Open Blaukovitch opened 7 months ago

Blaukovitch commented 7 months ago

Hi everyone! Due to the huge size of the compiled chrome.dll dynamic library there is a need to split it into two parts (according to DirectX 9 and DirectX 11 criteria, for example) to optimize loading speed and reduce RAM consumption. If it is technically possible in the current realities, of course.

mserafym commented 7 months ago

Hi everyone! Due to the huge size of the compiled chrome.dll dynamic library there is a need to split it into two parts (according to DirectX 9 and DirectX 11 criteria, for example) to optimize loading speed and reduce RAM consumption. If it is technically possible in the current realities, of course.

  • chrome_dx9.dll (fail main and XP/2003 native support)
  • chrome.dll (main)

This proposal is, IMHO, complete nonsense. The game is not worth the candle. I’m wondering, how do you imagine this? This is incredibly difficult to do, especially since at the moment there is no working support for directx 9 under Windows XP.

Blaukovitch commented 7 months ago

@mserafym, yes, I understand that it is difficult at this time. This requires support from the compiler/linker - it is necessary to mark (ex new #pragma macro) main procedures that need to be put into a separate library when building the whole project & build a dependency tree for each library separately. The linker will have to make a second pass to build a separate library using some of the ready object files.

upd: Here is a fundamental design error by Google LLC: about 200 Megabytes is too much for the PE COFF format. This error will further exacerbate the performance and memory consumption situation for systems on Windows 2000 (which is scheduled to return in the future) and is already negatively impacting boot speeds on Windows XP. Initially in version 49, which is the official extreme for Windows XP, this problem simply did not exist, as chrome.dll had a weight of about 30 Megabytes. Now the size has grown by more than 7 times and will grow to infinity every time. Google should have come up with separation criteria from the beginning. For example, like in the gaming industry into DirectX versions or by process type (mojom/render/gpu/main). But Google engineers successfully missed the right moment and now users are paying for this mistake. For Windows 10/11, the upside is that the vast majority use SSDs to boot, have more memory, and also have a slightly tweaked PE format boot (the import table fills up a bit faster than in earlier versions of Windows). In the case of running the browser on an average Windows XP configuration it is not the fastest HDD (maybe even IDE) and about 2 Gbytes of RAM. At best it would be a WD VelociRaptor (10k) and 4-8 Gigabytes of fast DDR2 Corsair Dominator RAM.

Juesto commented 7 months ago

sure, but you need to understand that chrome is pretty feature packed, you would want flags and all development/experimental features removed to make it lighter with how bloated it is there's maybe more overhead processing multiple libraries than a single one at once

win32ss commented 7 months ago

Chromium has the build option is_component_build, which produces many DLLs. Surprisingly they made some documentation on how to properly use it: https://chromium.googlesource.com/chromium/src/+/master/docs/component_build.md

I tried this a long time ago when I only had 12 GB of RAM, but it did not help as it was still building chrome.dll in addition to the other DLLs. But I will consider this option again.

I also found this document on a previous option to split chrome.dll in half: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/windows_split_dll.md (and specifically the commits mentioned here that removed the option: https://issues.chromium.org/issues/40120268)

Blaukovitch commented 7 months ago

The important point here is to make sure that one of the split libraries is loaded into the process, then the split has a useful effect. If two libraries are loaded at once, it will only make things worse. Thus, some additional checking criteria will be needed before loading one of the CHROME_X.DLL libraries.

Uber-1 commented 6 months ago

Yeah, you may take a look for Iron 49 till now and see two over40MB DLLs. Screenshot -- https://i.imgur.com/dxAZMmX.png Original package -- http://download1.srware.net/old/iron/win/49/ Is there any reason to try something like that now?