GCC/Make Build Time Optimizations

前端 未结 10 651
鱼传尺愫
鱼传尺愫 2021-02-02 01:22

We have project which uses gcc and make files. Project also contains of one big subproject (SDK) and a lot of relatively small subprojects which use that SDK and some shared fra

10条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-02 01:57

    Using small files may not always be a good recommendation. A disk have a 32 or 64K min sector size, with a file taking at least a sector. So 1024 files of 3K size (small code inside) will actually take 32 or 64 Meg on disk, instead of the expected 3 meg. 32/64 meg that needs to be read by the drive. If files are dispersed around on the disk you increase read time even more with seek time. This is helped with Disk Cache obviously, to a limit. pre-compiled header can also be of good help alleviating this.

    So with due respect to coding guidelines, there is no point in going out of them just to place each strcuct, typedef or utility class into separate files.

提交回复
热议问题