Pages: 1 2 [3]   Go Down
Author Topic: Arduino 1.0 produces 25% larger binary?  (Read 7018 times)
0 Members and 1 Guest are viewing this topic.
New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If there are things we can do so that DHCP and DNS aren't compiled in if they aren't used, that would be great. 
I thought we were already using the compilation parameters that enabled this? (Putting functions into separate blocks that aren't included by the linker if not used or something like that.)

What might make this a slightly moot point in terms of the example: Shouldn't the basic example use DNS anyway instead of hardcoding an IP address for Google?

--Philip;
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 132
Posts: 6739
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmm.  In fact, the WebClient example does use DHCP for its initial config now.
I can't figure out how DNS is getting pulled in, though.  EthernetClient::connect() does call dns, but only in the method that has a string argument, so I thought that would be enough to get it omitted during link...
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 205
Posts: 12844
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Could a virtual connect be the culprit...

Quote
class EthernetClient : public Client {
public:
...
  virtual int connect(IPAddress ip, uint16_t port);
  virtual int connect(const char *host, uint16_t port);
...

Logged

North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 69
Posts: 2165
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe, two virtual members only creates an overhead of two pointers in the v-table ( pointers to the derived type ) during run-time.

But sometimes can increase code generation by upto 50 bytes per 'virtual' usage, sometimes even more.

If you have no need to control many different derived interfaces through a unique single interface, scrap the base class.

Arduino should #define it to turn off the client class when not needed.
« Last Edit: December 17, 2011, 02:20:22 am by pYro_65 » Logged


Pages: 1 2 [3]   Go Up
Jump to: