Why is SQLite merging its code?

Every time I download SQLite, I come across the fact that they provide several different versions of the source code, which I have never seen in other projects. And even more so, they provide Source Combining, this kind of combine all their files into only 3 files. What is the reason for this? Is it just compilation speed? Or are there some really good reasons for this? Are other source code merge projects being used?

+5
source share
3 answers

As indicated directly on the merge page

In addition to simplifying the integration of SQLite into other projects, consolidation also speeds up its work. Many compilers can perform additional code optimizations when they are contained in a single translation unit, for example, in a union. We measured a performance improvement of 5 to 10% when we use the join to compile SQLite, rather than individual source files. The disadvantage of this is that additional optimizations often take the form of a function that seeks to increase the size of the resulting binary image.

I myself see the inclusion in other projects of the greatest benefit. It just makes collection easier. No build script mess and everything else follows from a large collection of source files.

+10
source

. .h .c , SQLite.

. , .

+4

When I trid divide the merge file into separate files under windows with the C ++ dev compiler, I have a lot of questions. Because I want sqlite to work in RTOS, which is called DJYOS, it is easier to change the code from individual files than from merging.

0
source

All Articles