DLL Size differences and other info requested

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

DLL Size differences and other info requested

Stephen Chrzanowski
Just for kicks because I wanted to learn "how it was done", I decided to
download the amalgamation code and compile to a Win32 DLL.  The secondary
purpose of my doing so was that I also wanted to write a 3rd party app
that'd export all headers of the amalgamation to a different format that I
can then use to build into my own units in Delphi.  Basically convert the C
headers into Delphi headers so I can link to the DLL of the same version.
You know, just for "fun".  Whether or not my rearranging code works or
not.. well.. Its all on my dime, a learning experience, and probably to the
professionals in the crowd it'd seem like a waste of time.  To them I say
"meh".  ;)

The one thing I DID notice though is that my compiled version of the DLL in
size is much different than what the compiled version is on the
sqlite.orgsite.  Is there a particular reason for this?  What compiler
options do I
set to bring my the size of the DLL down or is it just the nature of the
amalgamation?  Just for reference, my DLL, which I baked in the oven about
30 minutes ago now, weighs in at about 850k while the pre-compiled Win32
download version looks to be about 620k.  The wife says I need to cut back
on calories, so I thought I might start with my hard drives and see how
that goes. ;)  I'm compiling under Bloodshed Dev-C++ v4.9.9.2.

The other thing I wanted to know is whether or not it'd be possible to get
source code snapshots of the amalgamation code starting from v3.0 (EDIT:
Seemingly 3.2?). or whatever this process started at starting at the major
build version 3, and get the incremental "published builds".  I've looked
at the timeline and at http://www.sqlite.org/cgi/src/brlist and I see that
the individual files have been modified and checked in, etc, but I don't
seem to be able to find sqlite3.c and sqlite.h, or even how I can download
a snapshot of the package of that revision even if it is just the
individual C files.

Is everything in the downloaded archive basically a merge (Think "copy
file1+file2+file3 file_final") of all of the required C files when a full
build to make the different pre-built packages are done?  I'm also a
complete newb when it comes to the version control being used for SQLite.
I know of version control software, and I use a Win32 only VCS, so have
absolutely zero clue on how to obtain a particular version of the code
through the means graciously provided.  If someone has the time, I'd
greatly appreciate a walk through on what to do, and what software has to
be put onto my dev machines.

I'm a pack rat when it comes to any and all software I come across, so what
I'm doing I think flies in the face of what my wife has asked me to do in
regards to calories. {smirk}
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: DLL Size differences and other info requested

Philip Bennefall
Hi Stephen,

I don't know what compiler is used to build the official SqLite dll, but
provided it is some version of Vc++ my experience is that MinGw often
produces larger and sometimes significantly slower binaries on Windows than
VC++ does. In an unrelated project of mine, the binary size dropped by about
500 KB when I switched from Dev-C++/MinGw to Code::Blocks/MSVC++. This is
mere speculation on my part in this case, however, as I don't actually know
what compiler that is being used to build the official dll.

Kind regards,

Philip Bennefall
----- Original Message -----
From: "Stephen Chrzanowski" <[hidden email]>
To: "General Discussion of SQLite Database" <[hidden email]>
Sent: Thursday, July 04, 2013 12:37 AM
Subject: [sqlite] DLL Size differences and other info requested


Just for kicks because I wanted to learn "how it was done", I decided to
download the amalgamation code and compile to a Win32 DLL.  The secondary
purpose of my doing so was that I also wanted to write a 3rd party app
that'd export all headers of the amalgamation to a different format that I
can then use to build into my own units in Delphi.  Basically convert the C
headers into Delphi headers so I can link to the DLL of the same version.
You know, just for "fun".  Whether or not my rearranging code works or
not.. well.. Its all on my dime, a learning experience, and probably to the
professionals in the crowd it'd seem like a waste of time.  To them I say
"meh".  ;)

The one thing I DID notice though is that my compiled version of the DLL in
size is much different than what the compiled version is on the
sqlite.orgsite.  Is there a particular reason for this?  What compiler
options do I
set to bring my the size of the DLL down or is it just the nature of the
amalgamation?  Just for reference, my DLL, which I baked in the oven about
30 minutes ago now, weighs in at about 850k while the pre-compiled Win32
download version looks to be about 620k.  The wife says I need to cut back
on calories, so I thought I might start with my hard drives and see how
that goes. ;)  I'm compiling under Bloodshed Dev-C++ v4.9.9.2.

The other thing I wanted to know is whether or not it'd be possible to get
source code snapshots of the amalgamation code starting from v3.0 (EDIT:
Seemingly 3.2?). or whatever this process started at starting at the major
build version 3, and get the incremental "published builds".  I've looked
at the timeline and at http://www.sqlite.org/cgi/src/brlist and I see that
the individual files have been modified and checked in, etc, but I don't
seem to be able to find sqlite3.c and sqlite.h, or even how I can download
a snapshot of the package of that revision even if it is just the
individual C files.

Is everything in the downloaded archive basically a merge (Think "copy
file1+file2+file3 file_final") of all of the required C files when a full
build to make the different pre-built packages are done?  I'm also a
complete newb when it comes to the version control being used for SQLite.
I know of version control software, and I use a Win32 only VCS, so have
absolutely zero clue on how to obtain a particular version of the code
through the means graciously provided.  If someone has the time, I'd
greatly appreciate a walk through on what to do, and what software has to
be put onto my dev machines.

I'm a pack rat when it comes to any and all software I come across, so what
I'm doing I think flies in the face of what my wife has asked me to do in
regards to calories. {smirk}
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: DLL Size differences and other info requested

R Smith
In reply to this post by Stephen Chrzanowski
Simply manipulating the compile-time options will create widely differing sizes. You can exclude older support items etc.
A good overview of the compile-time options are given on the SQLite site.

(Ok I'll stop being lazy and find you the actual link)
http://www.sqlite.org/compile.html

There, good luck!


On 2013/07/04 00:37, Stephen Chrzanowski wrote:
> Just for kicks because I wanted to learn "how it was done", I decided to
> download the amalgamation code and compile to a Win32 DLL.  The secondary
> purpose of my doing so was that I also wanted to write a 3rd party app.....//



_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: DLL Size differences and other info requested

Stephen Chrzanowski
That link certainly helps.  I'll poke at 'em.


On Wed, Jul 3, 2013 at 6:53 PM, RSmith <[hidden email]> wrote:

> Simply manipulating the compile-time options will create widely differing
> sizes. You can exclude older support items etc.
> A good overview of the compile-time options are given on the SQLite site.
>
> (Ok I'll stop being lazy and find you the actual link)
> http://www.sqlite.org/compile.**html <http://www.sqlite.org/compile.html>
>
> There, good luck!
>
>
>
> On 2013/07/04 00:37, Stephen Chrzanowski wrote:
>
>> Just for kicks because I wanted to learn "how it was done", I decided to
>> download the amalgamation code and compile to a Win32 DLL.  The secondary
>> purpose of my doing so was that I also wanted to write a 3rd party
>> app.....//
>>
>
>
>
> ______________________________**_________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users>
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: DLL Size differences and other info requested

fnoyanisi
As far as I remember, DevC++ does not have "strip" option enabled by default for "release" version of your binary. You may want to have a quick look at your project compile options to minimize your binary size. The "-s" option reduces binary size significantly in some cases.



________________________________
 From: Stephen Chrzanowski <[hidden email]>
To: [hidden email]; General Discussion of SQLite Database <[hidden email]>
Sent: Thursday, July 4, 2013 8:29 AM
Subject: Re: [sqlite] DLL Size differences and other info requested
 

That link certainly helps.  I'll poke at 'em.


On Wed, Jul 3, 2013 at 6:53 PM, RSmith <[hidden email]> wrote:

> Simply manipulating the compile-time options will create widely differing
> sizes. You can exclude older support items etc.
> A good overview of the compile-time options are given on the SQLite site.
>
> (Ok I'll stop being lazy and find you the actual link)
> http://www.sqlite.org/compile.**html <http://www.sqlite.org/compile.html>
>
> There, good luck!
>
>
>
> On 2013/07/04 00:37, Stephen Chrzanowski wrote:
>
>> Just for kicks because I wanted to learn "how it was done", I decided to
>> download the amalgamation code and compile to a Win32 DLL.  The secondary
>> purpose of my doing so was that I also wanted to write a 3rd party
>> app.....//
>>
>
>
>
> ______________________________**_________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users>
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: DLL Size differences and other info requested

Stephen Chrzanowski
Step in the right direction.  Went from 850 to 788 with just that simple
switch.  I'll read  up on what that compiler option does.


On Wed, Jul 3, 2013 at 7:08 PM, Fehmi Noyan ISI <[hidden email]> wrote:

> As far as I remember, DevC++ does not have "strip" option enabled by
> default for "release" version of your binary. You may want to have a quick
> look at your project compile options to minimize your binary size. The "-s"
> option reduces binary size significantly in some cases.
>
>
>
> ________________________________
>  From: Stephen Chrzanowski <[hidden email]>
> To: [hidden email]; General Discussion of SQLite Database <
> [hidden email]>
> Sent: Thursday, July 4, 2013 8:29 AM
> Subject: Re: [sqlite] DLL Size differences and other info requested
>
>
> That link certainly helps.  I'll poke at 'em.
>
>
> On Wed, Jul 3, 2013 at 6:53 PM, RSmith <[hidden email]> wrote:
>
> > Simply manipulating the compile-time options will create widely differing
> > sizes. You can exclude older support items etc.
> > A good overview of the compile-time options are given on the SQLite site.
> >
> > (Ok I'll stop being lazy and find you the actual link)
> > http://www.sqlite.org/compile.**html <http://www.sqlite.org/compile.html
> >
> >
> > There, good luck!
> >
> >
> >
> > On 2013/07/04 00:37, Stephen Chrzanowski wrote:
> >
> >> Just for kicks because I wanted to learn "how it was done", I decided to
> >> download the amalgamation code and compile to a Win32 DLL.  The
> secondary
> >> purpose of my doing so was that I also wanted to write a 3rd party
> >> app.....//
> >>
> >
> >
> >
> > ______________________________**_________________
> > sqlite-users mailing list
> > [hidden email]
> > http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users>
> >
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: DLL Size differences and other info requested

Stephen Chrzanowski
I just reduced my built file size to BELOW what comes "out of the box" from
sqlite.org.  I've turned off all optimizations and ran a full build.  I'm
now sitting at the 599k mark.  So, the next process I'm going to have to
come up with some testing to validate whether optimizations should be
turned on or off when building this.  I'm aware that turning off
optimizations "should" increase speed, since this will eliminate certain
checks like range checking, io checking, etc.  None of my code needs to be
all that robust since 100% of my code that deals with SQLite is running on
one of my computers on my LAN. ;)
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: DLL Size differences and other info requested

fnoyanisi
You can also consider using -lstdc++_s (dynamic linkage for libstdc++) and -Os (optimize size) options to reduce the execuatble size in MinGW. I've never used VC++ (mostly using Linux and MinDW in Win32) but as far as I know, VC++ is capable of producing much more smaller executable.


As being released by Microsoft, VC++ has almost all the libraries shipped with Windows and there is a minor need for static linking for a simple program that does not make us of extra libraries. This story turns into other way for MinGW (Linux GCC executables are not that huge)


________________________________
 From: Stephen Chrzanowski <[hidden email]>
To: Fehmi Noyan ISI <[hidden email]>; General Discussion of SQLite Database <[hidden email]>
Sent: Thursday, July 4, 2013 9:08 AM
Subject: Re: [sqlite] DLL Size differences and other info requested
 


I just reduced my built file size to BELOW what comes "out of the box" from sqlite.org.  I've turned off all optimizations and ran a full build.  I'm now sitting at the 599k mark.  So, the next process I'm going to have to come up with some testing to validate whether optimizations should be turned on or off when building this.  I'm aware that turning off optimizations "should" increase speed, since this will eliminate certain checks like range checking, io checking, etc.  None of my code needs to be all that robust since 100% of my code that deals with SQLite is running on one of my computers on my LAN. ;)
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: DLL Size differences and other info requested

Roger Binns
In reply to this post by Stephen Chrzanowski
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/07/13 16:38, Stephen Chrzanowski wrote:
> I just reduced my built file size to BELOW what comes "out of the box"
> from sqlite.org.  I've turned off all optimizations and ran a full
> build.  I'm now sitting at the 599k mark.

You probably want -Os

   http://www.sqlite.org/footprint.html

Roger

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlHUyqQACgkQmOOfHg372QTkQACgkKeNo1Qk5G4sgdkLJZPKV/Ai
0nkAn34ULSWYCsNk6I5WHvDViQOeTRTJ
=OMxe
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: DLL Size differences and other info requested

Dan Kennedy-4
In reply to this post by Philip Bennefall
On 07/04/2013 05:49 AM, Philip Bennefall wrote:

> Hi Stephen,
>
> I don't know what compiler is used to build the official SqLite dll,
> but provided it is some version of Vc++ my experience is that MinGw
> often produces larger and sometimes significantly slower binaries on
> Windows than VC++ does. In an unrelated project of mine, the binary
> size dropped by about 500 KB when I switched from Dev-C++/MinGw to
> Code::Blocks/MSVC++. This is mere speculation on my part in this case,
> however, as I don't actually know what compiler that is being used to
> build the official dll.

Those on the website are built with mingw 4.5.2 using:

   -Os
   -DSQLITE_ENABLE_FTS3
   -DSQLITE_ENABLE_RTREE
   -DSQLITE_ENABLE_COLUMN_METADATA

In case anyone was wondering.


_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: DLL Size differences and other info requested

Philip Bennefall
Hi Dan,

Thanks for that info. Do you have any views on compiling SqLite optimized
for speed rather than size? Is the difference in performance generally small
enough to be ignored? I am using Vc++ 2010 express and have been optimizing
for speed up until now.

Kind regards,

Philip Bennefall
----- Original Message -----
From: "Dan Kennedy" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, July 04, 2013 5:12 PM
Subject: Re: [sqlite] DLL Size differences and other info requested


On 07/04/2013 05:49 AM, Philip Bennefall wrote:

> Hi Stephen,
>
> I don't know what compiler is used to build the official SqLite dll,
> but provided it is some version of Vc++ my experience is that MinGw
> often produces larger and sometimes significantly slower binaries on
> Windows than VC++ does. In an unrelated project of mine, the binary
> size dropped by about 500 KB when I switched from Dev-C++/MinGw to
> Code::Blocks/MSVC++. This is mere speculation on my part in this case,
> however, as I don't actually know what compiler that is being used to
> build the official dll.

Those on the website are built with mingw 4.5.2 using:

   -Os
   -DSQLITE_ENABLE_FTS3
   -DSQLITE_ENABLE_RTREE
   -DSQLITE_ENABLE_COLUMN_METADATA

In case anyone was wondering.


_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: DLL Size differences and other info requested

Simon Slavin-3

On 4 Jul 2013, at 4:36pm, Philip Bennefall <[hidden email]> wrote:

> Thanks for that info. Do you have any views on compiling SqLite optimized for speed rather than size? Is the difference in performance generally small enough to be ignored? I am using Vc++ 2010 express and have been optimizing for speed up until now.

Optimizing for anything only matters when that thing matters.  In these days of fast computers and cheap memory computers spend most of their time waiting for you to type something and every memory device has a gigabyte or two free.

Ignore optimization, or just go with whatever the defaults are, until you get dissatisfied with that thing.  Spend more time on making your application more fun to use.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: DLL Size differences and other info requested

James K. Lowden
In reply to this post by Philip Bennefall
On Thu, 4 Jul 2013 17:36:37 +0200
Philip Bennefall <[hidden email]> wrote:

> Do you have any views on compiling SqLite optimized for speed rather
> than size?

These days, size is speed.  The smaller the code, the better it fits in
cache, the faster it runs.  The days of unrolling loops to avoid
branches in the pipeline are long gone.  

--jkl
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users