Results 1 to 17 of 17

Thread: Executable compiled on Vista loads faster than compiled on XP

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2019
    Posts
    51

    Executable compiled on Vista loads faster than compiled on XP

    This is a strange one. I've got a fairly simple console executable that looks up various things in a local Access database and prints it to the console (using Karl Peterson's MConsole.bas) and a file. There's nothing particularly exceptional about it.

    When I compile the program on Vista, it executes instantly on XP machine #1, providing feedback. If I compile the program on XP machine #2 and execute it on XP machine #1 (the same XP box that the Vista compiled executable runs instantly on), it takes several seconds to provide feedback. (I don't have VB setup on XP machine #1 to even compile it there and see if the problem persists.)

    If I do a file compare on the two executables (Vista compiled vs XP compiled), there are binary differences -- which is odd, but probably not unexpected given the different OSes making the files. I thought maybe some oddball references were causing issues, but only these references are set:

    Visual Basic For Applications
    Visual Basic runtime objects and procedures
    Visual Basic objects and procedures
    OLE Automation
    Microsoft DAO 3.5 Object Library

    To weed out any (very unlikely) issues with MConsole.bas, I removed it and removed the associated console printing. That made no difference.

    Anyone seen anything like this before?


    Edit The cause was related to vbAdvance add-in. Details and solution in this post.
    Last edited by Montclair; Jun 30th, 2022 at 07:29 AM.

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Executable compiled on Vista loads faster than compiled on XP

    Hard to imagine. Sure feels like there is more information we would need to help.

    VB6 provides about 100% of the compilation toolchain, so there should be no difference aside from timestamps and other trivia.

    All I can image is different sets of patches applied to VB6 on the two machines.

    I'd probably start by grabbing a wooden ruler and rapping one hand hard with the other for using DAO at all, but aside from that I can't think what might help.

  3. #3
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,852

    Re: Executable compiled on Vista loads faster than compiled on XP

    Two things come to mind to me:

    1) Different VB6 service pack.

    2) There's a virus on one of the machines that's attaching to any new executables it sees.

    p.s. I use the DAO ... 3.6 though. Dil just puts up with me though.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  4. #4
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Executable compiled on Vista loads faster than compiled on XP

    So you executes both .exes on the same XP machine?

    This looks like something is going on with the .exe certificate check or anti-virus check or .exe reputation check or .exe 'Zone.Id' alternative data stream check (so called Mark-of-the-Web).

    cheers,
    </wqw>

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2019
    Posts
    51

    Re: Executable compiled on Vista loads faster than compiled on XP - SOLVED

    Thanks for the replies guys. I found the problem after reading all of your posts (that were great ideas, but not the issue).

    I have the "vbAdvance" add-in installed on both the source XP and source Vista machines. It doesn't automatically load in the IDE on the XP machine, while it does on the Vista machine. Just out of curiosity, I enabled it on the XP source machine, opened up the "Advanced Options", just clicked "Ok" without changing anything, compiled, and the problem went away.

    Why it makes a difference, I don't know. The project was already set with "Build As Console Application" checked, so -- who knows?

    EDIT:
    Cause: vbAdvance doesn't store the flag to compile as a console application in the vb project file in a way that vb knows how to do anything with it, unless the add-in is loaded.

    Solution: Load vbAdvance at compile time, or make console applications manually with linker instructions.
    Last edited by Montclair; Jun 30th, 2022 at 07:31 AM.

  6. #6
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    Re: Executable compiled on Vista loads faster than compiled on XP

    IF USE SQLITE,maybe fast than access database?

    ADO,DAO,SQLITE,Which way is faster?

    RC5 Sqlite Like Adodb.Connection/Adodb.RecordSet(WithOut Reg Com Dll)-VBForums
    https://www.vbforums.com/showthread....t-Reg-Com-Dll)

  7. #7

    Thread Starter
    Member
    Join Date
    Oct 2019
    Posts
    51

    Re: Executable compiled on Vista loads faster than compiled on XP

    Quote Originally Posted by xiaoyao View Post
    IF USE SQLITE,maybe fast than access database?

    ADO,DAO,SQLITE,Which way is faster?

    RC5 Sqlite Like Adodb.Connection/Adodb.RecordSet(WithOut Reg Com Dll)-VBForums
    https://www.vbforums.com/showthread....t-Reg-Com-Dll)
    Actual performance once the code starts running wasn't the problem. I certainly can't go converting to other DB formats without a major overhaul of all of our systems -- and that's not happening anytime soon, if ever. This is just one tiny "here's the status of everything right now" program, for employees to hit from their cellphones, to determine what time they need to start working.

    The issue was resolved above your post. Thanks, anyway!

  8. #8
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    Re: Executable compiled on Vista loads faster than compiled on XP

    Running exe on different operating systems results in different database read and write speeds.
    Compile three exes on xp/win7/win10, and then run them on the same computer. The speed may be different.
    Sqlite DLL can ensure faster read and write speed than access MDB database on different operating systems, and it is relatively stable, and will not become slower due to the impact of ADO, Dao, ODBC, etc.
    If you have higher requirements for reading and writing speed, it may be better to change the access database format to SQLite.
    And the code of the program is rarely changed or completely unchanged.

  9. #9
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,852

    Re: Executable compiled on Vista loads faster than compiled on XP

    Quote Originally Posted by Montclair View Post
    Thanks for the replies guys. I found the problem after reading all of your posts (that were great ideas, but not the issue).

    I have the "vbAdvance" add-in installed on both the source XP and source Vista machines. It doesn't automatically load in the IDE on the XP machine, while it does on the Vista machine. Just out of curiosity, I enabled it on the XP source machine, opened up the "Advanced Options", just clicked "Ok" without changing anything, compiled, and the problem went away.

    Why it makes a difference, I don't know. The project was already set with "Build As Console Application" checked, so -- who knows?
    Well golly gee, one of us should have thought about the compile options (which is what I believe is being tampered with by that vbAdvance add-in, as well as possibly some linker options). Changing any of those would almost certainly change the written executable (EXE file). Also, depending on what you're doing, I can promise that some of the "Advanced Optimizations" can dramatically change the performance speeds of your application. In fact, in one instance (a smoothing algorithm), I compile it into an ActiveX.dll for maximum speed, just to get those benefits.

    Glad you found it.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  10. #10
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Executable compiled on Vista loads faster than compiled on XP

    I'm still unconvinced.

    The symptoms described don't seem to relate to any code optimizations, but then we haven't seen any code so it might be doing really bizarre stuff and spinning its wheels a lot.

  11. #11

    Thread Starter
    Member
    Join Date
    Oct 2019
    Posts
    51

    Re: Executable compiled on Vista loads faster than compiled on XP

    Quote Originally Posted by xiaoyao View Post
    Running exe on different operating systems results in different database read and write speeds.
    I have no doubt that's true, however, running the exe on different OSes wasn't the problem. Running the same project exe on one OS, compiled on different OSes, was the problem.

    The problem really wasn't performance. The problem was an initial launch slowness. I'm 99% certain that the lack of having vbAdvance add-in open on the XP machine was causing VB to not create a console application, hence the start up delay.

    Quote Originally Posted by xiaoyao View Post
    Compile three exes on xp/win7/win10, and then run them on the same computer. The speed may be different.
    All compile options being equal, I'm not too sure I agree with that. Anything is possible, though. Regardless, this really wasn't a speed issue. It was either an actual or perceived output delay at the launch of the program.

    Quote Originally Posted by xiaoyao View Post
    Sqlite DLL can ensure faster read and write speed than access MDB database on different operating systems, and it is relatively stable, and will not become slower due to the impact of ADO, Dao, ODBC, etc.
    If you have higher requirements for reading and writing speed, it may be better to change the access database format to SQLite.
    And the code of the program is rarely changed or completely unchanged.
    Oh, it's pretty much well established that other DBs are faster. That wasn't the issue here. There would be major code changes across at least 20 different applications and front-ends to convert the multiple MDBs involved in this company's system. That's not going to happen just to accommodate this almost insignificant program.

    Thanks!
    Last edited by Montclair; Jun 30th, 2022 at 06:58 AM.

  12. #12

    Thread Starter
    Member
    Join Date
    Oct 2019
    Posts
    51

    Re: Executable compiled on Vista loads faster than compiled on XP

    Quote Originally Posted by dilettante View Post
    I'm still unconvinced.

    The symptoms described don't seem to relate to any code optimizations, but then we haven't seen any code so it might be doing really bizarre stuff and spinning its wheels a lot.
    Not sure what to tell you, but not having the add-in loaded at compile time was definitely the problem. Once loaded, the compiled exe performs as expected regardless of which OS created it. I'm guessing that vb wasn't creating a console application properly when compiled on the XP machine.

    The code itself isn't doing anything bizarre. This is just a tiny application reading data from some MDBs and dumping them into text file. No bizarre stuff.

    Thanks!
    Last edited by Montclair; Jun 30th, 2022 at 07:00 AM.

  13. #13

    Thread Starter
    Member
    Join Date
    Oct 2019
    Posts
    51

    Re: Executable compiled on Vista loads faster than compiled on XP

    Quote Originally Posted by Elroy View Post
    Well golly gee, one of us should have thought about the compile options (which is what I believe is being tampered with by that vbAdvance add-in, as well as possibly some linker options). Changing any of those would almost certainly change the written executable (EXE file). Also, depending on what you're doing, I can promise that some of the "Advanced Optimizations" can dramatically change the performance speeds of your application. In fact, in one instance (a smoothing algorithm), I compile it into an ActiveX.dll for maximum speed, just to get those benefits.

    Glad you found it.
    Me too. Was driving me nuts!

    I'm not really doing anything spectacular. Reading database fields, and dumping them into an HTML file is essentially it, which is why this was perplexing enough for me to start this thread.

  14. #14
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Executable compiled on Vista loads faster than compiled on XP

    Quote Originally Posted by Montclair View Post
    Not sure what to tell you, but not having the add-in loaded at compile time was definitely the problem. Once loaded, the compiled exe vb generates performs as expected regardless of which OS it was compiled on. I'm guessing that vb wasn't creating a console application properly on the XP machine.
    You don't need an add-in for this if you are willing to one time manually edit your .vbp file and copy/paste these two lines of undocumented LinkSwitches.

    cheers,
    </wqw>

  15. #15

    Thread Starter
    Member
    Join Date
    Oct 2019
    Posts
    51

    Re: Executable compiled on Vista loads faster than compiled on XP

    Quote Originally Posted by wqweto View Post
    You don't need an add-in for this if you are willing to one time manually edit your .vbp file and copy/paste these two lines of undocumented LinkSwitches.

    cheers,
    </wqw>
    Yep, I know, but using the add-in and checking a box is easier. And, that's why I didn't even consider that as a source of the problem. It should be a set it and forget it thing.
    Last edited by Montclair; Jun 30th, 2022 at 07:12 AM.

  16. #16
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Executable compiled on Vista loads faster than compiled on XP

    Quote Originally Posted by Montclair View Post
    It should be a set it and forget it thing.
    Btw, it's a one time edit in your .vbp file. (You don't have to "remember" about it once it's edited.)

    cheers,
    </wqw>

  17. #17

    Thread Starter
    Member
    Join Date
    Oct 2019
    Posts
    51

    Re: Executable compiled on Vista loads faster than compiled on XP

    Quote Originally Posted by wqweto View Post
    Btw, it's a one time edit in your .vbp file. (You don't have to "remember" about it once it's edited.)

    cheers,
    </wqw>
    Right, and I assumed vbAdvance was doing exactly that behind the scenes. Load the add-in, check the "Make a console application" box once, save the project, and done. Who cares if the add-in is loaded or not for that to happen in the future?

    But, I see the issue now. vbAdvance doesn't apparently remind vb to create a console application that way (no mention of the LinkSwitches anywhere in the .vbp). There's a separate section in .vpb file, though, for the vbAdvance options, and it seems logical that the add-in needs to be loaded for it to tell vb to do anything with them:

    [vbAdvance]
    IsConsole=1
    HasStubFile=0
    GenerateMap=0
    TSAware=0
    XPManifest=0
    ResBuildName=..\..\Httpd\Cgi-Bin\[removed]
    ReplaceIcon=0
    SendCommandArgs=0
    SymbDbgPref=0
    RevisionVersion=0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width