欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > 能源 > Chroium 源码目录结构分析(1):源码目录体积一栏

Chroium 源码目录结构分析(1):源码目录体积一栏

2025/5/3 18:03:24 来源:https://blog.csdn.net/hebhljdx/article/details/139502241  浏览:    关键词:Chroium 源码目录结构分析(1):源码目录体积一栏

获取源码

首先,我们拉一份最新的源代码(笔者是2024.6.6日拉取的):

fetch --nohistory chromium

源码预处理

如果运行build,会生成许多生成的代码,因此我们不运行build。

然后,把干扰后续分析的.git目录删除。这次拉取仅仅从源文件的物理结构对chromium进行分析。

rd /s /q .git

然后删除testsdata、test等相关的文件,减少理解源码功能的干扰。

@echo off
setlocal enabledelayedexpansionREM Define the root directory to start searching from
set "ROOT_DIR=src"REM Find all directories named "test" under the root directory and delete them
for /r "%ROOT_DIR%" %%d in (test) do (if /i "%%~nxd"=="test" (echo Deleting: "%%d"rd /s /q "%%d")
)echo Deletion complete.endlocal

还手动删除了一些数据

获取数据

目录体积一览

用space sniffer 可视化观察源码目录体积的情况,有个大概的印象:

从src根目录:可见体积最大的是third-party,占据了接近80%

放大我们后面会重点关注的src/content部分:

以及重点关注的thirdparty/blink:

文件类型聚类

接着,我们写个脚本,按文件类型,统计个数和大小:(File Types Analysis)

ExtensionFile CountTotal Size (bytes)
.h92392774105533
.cc787001011699744
[none]32369528603110
.js22251268799787
.sha121563863072
.c18014321187291
.py17853193770487
.cpp15631342358247
.html1310777496984
.ts1229887919096
.txt10025163453438
.java969781780064
.pbtxt767314195049
.json7410272957548
.md622731809118
.go571572429888
.gn570320890844
.png5611102977493
.mm551944819979
.xtb5163323351125
.frag42057609282
.pm365849830859
.xml304635833237
.map295348570301
.vert27614519297
.idl27146330826
.rs233750053349
.proto21329426761
.mojom17996385653
.sample17543230720
.yaml17073040011
.in164311598760
.sh16406088675
.pl151712907535
.icon14441821459
.css13768287662
.csv135165891710
.pod132623668650
.svg128512072576
.rst11967395627
.comp11642427107
.td103442924563
.S91322159427
.gni8485068002
.chromium826634536
.cfg7486186795
.inc744292674669
.yml6601235700
.cmake6182809973
.asm60616150717
.sksl601638268
.ttf59426986702
.bazel5832224953
.pem5697965101
.hpp56633897254
.bzl5514452617
.dll536206950836
.s4893164768
.test4622524462
.a46091781731
.tmpl4591411432
.pdf427161248367
.utf842411190941
.cjs3993569046
.bin35296919280
.patch3512601932
.sql3431388571
.def3346722034
.m3312704565
.hh3273742006
.pyc3103421089
.gif3057698487
.rts294202898
.wav28410097254
.bat2821842961
.BUILD277472005
.vk271161213
.key264425547
.jpg25612667896
.en2465889240
.tq2431415868
.template238604356
.ucm22220039087
.exe220975639548
.tesc220938125
.pb211220387
.mk211545744
.toml208327721
.cs2053693035
.webp2034960153
.swift199885223
.php1951528709
.mjs1863113129
.star1782438276
.so17813949612
.rb166679869
.pyi144304030
.grdp1404163500
.grd1365951416
.plist133211718
.pdb13076857344
.tese127465412
.zip1207022009
.euc-kr1091966786
.ico1062780310
.m41022198456
.tpl102793106
.man101357309
.mdoc99324131
.idx9510188780
.pack911356462055
.rev911446336
.gz89127234439
.rc87168686
.conf85242049
.pydeps82137908
.dict82356797
.al8264043
.yapf816371
.dox80549790
.orig79130748
.current_version7714439
.175443936
.avif701305373
.expected68863150
.json5681213323
.jsx68109086
.diff66721048
.mock-http-headers634294
.ogg61591480
.info61172965
.ini5834332
.woff2581331069
.fbs57335138
.tcl57377715
.pxi57257149
.bdic57112934430
.vue57110081
.build55226201
.scss55192410
.kt54386835
.textpb5369376
.dsc5348662
.dart53344885
.hyb521762492
.nc51137573
.am51642858
.f511364188
.cmd5096767
.jst5099630
.2645054395740
.geom5044572
.include49199229
.woff49924084
.xhtml49515027
.texi491956440
.aff4913875810
.dic49154174446
.textproto482488935
.lock483109574
.tlb45525492
.settings4410278
.tcc44910592
.evt447131
.gradle4370306
.aidl4042663
.TXT40272529
.pyd406201920
.properties4019738
.eot401361708
.rchit407308
.storyboard37231466
.mp4371882958
.lds3623048
.ipynb36975712
.flags3430045
.mod3336815
.options331192
.pc3325004
.compute3330662
.jinja23166533
.pyl31699967
.typed31488
.lua31407540
.lib3033084384
.pbxproj30902205
.dot2966483
.strings2932513
.raw29384009
.modulemap29539586
.dic_delta29442796
.hxx27139938
.jpeg277161209
.jar2623377841
.dat2666069008
.j22639960
.es26980221
.enc26280997
.unitjs26418755
.ps12584450
.rules23820993
.errordata2323597
.inl23508913
.xsl23335774
.podspec23522317
.vcproj22539682
.cxx221156567
.mac2280583
.log21186461
.de21868870
.o2141389
.cur2156918
.wasm209476297
.hlsl2096103
.fragment2030580
.sln2090004
.manifest1914019
.ver199448
.bmp19641343
.webm191367036
.markdown19111988
.hjson1934354
.mesh1971472
.cipd_version182187
.var18194614
.exp18249790
.el1883197
.rgen1815726
.version1715636
.entitlements177073
.sum17124231
.tar17247808
.vcxproj17185018
.bazelrc1744017
.hlo17839360
.jinja1615027
.cnf1638464
.ac16288424
.BSD1620320
.bp161026851
.sb1545622
.asset1539079
.applescript149784
.dtd14493656
.meson144077
.bash1424521
.bnf148666
.cl1473704

src 一级目录信息提取:写一段python脚本,自动提取第一层目录的特征和readme:

接下来移步:Chroium 源码目录结构分析(2)-CSDN博客

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词