为什么SQLite提供其代码的合并?

前端之家收集整理的这篇文章主要介绍了为什么SQLite提供其代码的合并?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
每次我下载sqlite时,我都会遇到这样一个事实,即他们提供了几个不同版本的源代码,这是我从未见过任何其他项目所做的事情.而且更多的是它们提供了源的合并,将所有文件合并为3个文件.这是什么原因?这只是编译速度吗?还是有一些非常好的理由呢?其他项目是否使用源代码合并?
直接在 page about amalgamation上说明

In addition to making sqlite easier to incorporate into other projects,the amalgamation also makes it run faster. Many compilers are able to do additional optimizations on code when it is contained with in a single translation unit such as it is in the amalgamation. We have measured performance improvements of between 5 and 10% when we use the amalgamation to compile sqlite rather than individual source files. The downside of this is that the additional optimizations often take the form of function inlining which tends to make the size of the resulting binary image larger.

我自己也看到了将其纳入其他项目的最大好处.它简单地使编译更容易.没有构建脚本混乱以及拥有大量源文件后的其他内容.

猜你在找的Sqlite相关文章