Speeding up of GNOME

Today I thought about how I can make my very own application to only link against those libraries that it really requires and not those it get provided by PKG-CONFIG.Problem-case:

When we use pkgconfig within our programs which of course makes sense, we also see that other libraries from other packages are being processed to our *_LIBS variables. So we end up in linking a lot of libraries to our application which we really do not need and which also causes (so I assume) a lot of overhead. After thinking for a while I looked some programs up by using:

readelf -d /usr/local/bin/gnome-terminal |grep NEEDED | wc -l

And saw that it was requiring over 52 libraries. I then recompiled gnome-terminal with

export CFLAGS = “-Os -s -Wl,–as-needed”

Pay attention to the –as-needed and the resulting binary required just 21 libraries afterwards instead of the 52 before because it only linked those really required to the final executable. I continued this with vte and saw that it required 29 libraries initially but after the –as-needed flag it went down to 7 libraries.

Now imagine this for the entire GNOME desktop or the entire KDE desktop and also package management systems which will reduce dependency tracking a lot. The problem with this method is that you surely don’t keep track of API compatibility but a good package management system will certainly make sure that the packages packed belong to a certain desktop version.

52 Comments

  1. 2005-03-30 7:30 pm
  2. 2005-03-30 7:32 pm
  3. 2005-03-30 7:43 pm
  4. 2005-03-30 7:48 pm
  5. 2005-03-30 7:57 pm
  6. 2005-03-30 8:00 pm
  7. 2005-03-30 8:02 pm
  8. 2005-03-30 8:17 pm
  9. 2005-03-30 8:39 pm
  10. 2005-03-30 9:09 pm
  11. 2005-03-30 9:12 pm
  12. 2005-03-30 9:34 pm
  13. 2005-03-30 9:39 pm
  14. 2005-03-30 10:00 pm
  15. 2005-03-30 10:02 pm
  16. 2005-03-30 10:32 pm
  17. 2005-03-30 10:54 pm
  18. 2005-03-30 11:05 pm
  19. 2005-03-30 11:10 pm
  20. 2005-03-30 11:23 pm
  21. 2005-03-30 11:37 pm
  22. 2005-03-30 11:46 pm
  23. 2005-03-30 11:48 pm
  24. 2005-03-31 12:18 am
  25. 2005-03-31 1:02 am
  26. 2005-03-31 1:14 am
  27. 2005-03-31 1:30 am
  28. 2005-03-31 2:38 am
  29. 2005-03-31 4:37 am
  30. 2005-03-31 6:23 am
  31. 2005-03-31 6:39 am
  32. 2005-03-31 8:18 am
  33. 2005-03-31 9:28 am
  34. 2005-03-31 1:51 pm
  35. 2005-03-31 2:30 pm
  36. 2005-03-31 2:56 pm
  37. 2005-03-31 2:59 pm
  38. 2005-03-31 3:25 pm
  39. 2005-03-31 3:38 pm
  40. 2005-03-31 9:11 pm
  41. 2005-03-31 9:25 pm
  42. 2005-03-31 9:46 pm
  43. 2005-03-31 9:57 pm
  44. 2005-03-31 11:04 pm
  45. 2005-03-31 11:27 pm
  46. 2005-04-01 3:24 am
  47. 2005-04-01 7:22 am
  48. 2005-04-02 5:52 am
  49. 2005-04-02 1:48 pm
  50. 2005-04-02 7:16 pm
  51. 2005-04-05 7:08 pm