Dead Code Stripping - Strip Unused Modules and Constants?

  1. 5 years ago

    Jeremy C

    11 Oct 2014 Pre-Release Testers, Xojo Pro Ohio, USA

    Does the dead code stripping in Xojo remove entire modules that are not used? For example, say I have a module DumbModule and it has 1 constant, DumbConstant ... No where in my entire app is DumbModule.DumbConstant accessed, is any part of it included in the resulting executable?

    normal constants are used in place when compiling...

  2. Christian S

    11 Oct 2014 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    The methods in the modules are stripped if not needed.

  3. Jeremy C

    11 Oct 2014 Pre-Release Testers, Xojo Pro Ohio, USA

    Christian, I am aware that the methods are stripped. Are you saying the constants are not?

  4. Christian S

    11 Oct 2014 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Answer Germany

    normal constants are used in place when compiling...

  5. Edited 5 years ago

    No, it is not included, based on the following.

    On Windows 7, Xojo 2014r2.1 in Desktop application, if a module "DumbModule" contains the below mentioned constant "DumbConstant" and that is not accessed in the application then the compiled Windows EXE does not contain that constant value when that EXE file is searched with UltraEdit text editor. However if the same "DumbConstant" is accessed in the application then the compiled Windows EXE does contain that constant value when that EXE file is searched with UltraEdit text editor.

    String type "DumConstant" assigned a value of "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".

  6. Christian S

    11 Oct 2014 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    As far as I see the dynamic constants are included always, even as being unused.

  7. Jeremy C

    11 Oct 2014 Pre-Release Testers, Xojo Pro Ohio, USA

    @ChristianSchmitz, of course. I should have thought of that, thanks!

    @Syed H, thanks for double checking that.

  8. Christian S

    11 Oct 2014 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    and I filled feedback case: 35778 - Compiler does not strip out unused dynamic constants

  9. Kevin G

    12 Oct 2014 Pre-Release Testers, Xojo Pro Gatesheed, England

    @ChristianSchmitz As far as I see the dynamic constants are included always, even as being unused.

    If you build with earlier versions of RB (2007/2008) you will find it does a much better job at stripping unused constants and code. This is something I noticed a few months back when I started updating our code. I logged a couple of bugs at the time but so far there doesn't seem to be any interest in fixing them.

or Sign Up to reply!