Archived Forum Post

Index of archived forum posts

Question:

Leaner version of HTTP library?

Dec 10 '12 at 10:19

Thanks again for the help in the past week.

I still have a question, we use the library only for the HTTP part. The HTTP component uses several other parts(ex. CKString) of the library and makes our application unnecessarily large. My question is, is it possible to get a leaner version of the library / HTTP component?

I like to hear what the possibilities are.


Answer

When linking with a C++ static library, the linker will only included code from the .lib that is directly or indirectly referenced. Therefore, it makes no difference if a .lib contains other classes or functions that are not referenced -- they are already not included in your .exe after linking.

Any serious HTTP implementation will certainly add significantly to the size of your EXE. It's because HTTP indirectly uses much of the underlying internal infrastructure within the Chilkat lib For example:

  1. SSL/TLS connections are supported, which means all code relating to digital certificates, PKCS signing/encryption, all encryption algorithms, hashes, hmac's, etc. are needed.
  2. HTTP responses can be compressed, and therefore the internal compression algorithms are needed.
  3. HTTP requests and responses are MIME, and therefore all of the MIME (also used by email), with all possible encoding/decoding functionality is required.
  4. HTTP can involve character encodings from any charset, both Unicode and multibyte charsets from any other language. The internal character encoding capabilities of Chilkat are fundamental across all classes/components and are not based on whatever underlying functionality is provided by a particular platform -- therefore the behavior will always be identical across all platforms.
  5. All sorts of other functionality is required -- authentication methods, proxy support, etc.

In summary, it's not possible to provide anything that would be leaner. The good news is that the size added to your EXE will not grow significantly over time as Chilkat continues to add more functionality. In fact, as each year passes, the size of the amount added to an EXE becomes less and less significant because mobile device memory capacities, cellular and network bandwidths, etc. continue to improve over time.