-
Jun 28th, 2022, 03:13 PM
#1
Thread Starter
Member
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.
-
Jun 28th, 2022, 04:08 PM
#2
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.
-
Jun 28th, 2022, 05:21 PM
#3
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.
-
Jun 29th, 2022, 03:21 AM
#4
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>
Last edited by wqweto; Jun 29th, 2022 at 03:53 AM.
-
Jun 29th, 2022, 01:21 PM
#5
Thread Starter
Member
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.
-
Jun 29th, 2022, 01:44 PM
#6
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)
-
Jun 29th, 2022, 03:05 PM
#7
Thread Starter
Member
Re: Executable compiled on Vista loads faster than compiled on XP
Originally Posted by xiaoyao
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!
-
Jun 29th, 2022, 03:29 PM
#8
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.
-
Jun 29th, 2022, 04:03 PM
#9
Re: Executable compiled on Vista loads faster than compiled on XP
Originally Posted by Montclair
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.
-
Jun 29th, 2022, 04:37 PM
#10
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.
-
Jun 30th, 2022, 06:40 AM
#11
Thread Starter
Member
Re: Executable compiled on Vista loads faster than compiled on XP
Originally Posted by xiaoyao
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.
Originally Posted by xiaoyao
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.
Originally Posted by xiaoyao
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.
-
Jun 30th, 2022, 06:44 AM
#12
Thread Starter
Member
Re: Executable compiled on Vista loads faster than compiled on XP
Originally Posted by dilettante
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.
-
Jun 30th, 2022, 06:53 AM
#13
Thread Starter
Member
Re: Executable compiled on Vista loads faster than compiled on XP
Originally Posted by Elroy
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.
-
Jun 30th, 2022, 06:58 AM
#14
Re: Executable compiled on Vista loads faster than compiled on XP
Originally Posted by Montclair
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>
-
Jun 30th, 2022, 07:04 AM
#15
Thread Starter
Member
Re: Executable compiled on Vista loads faster than compiled on XP
Originally Posted by wqweto
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.
-
Jun 30th, 2022, 07:07 AM
#16
Re: Executable compiled on Vista loads faster than compiled on XP
Originally Posted by Montclair
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>
-
Jun 30th, 2022, 07:14 AM
#17
Thread Starter
Member
Re: Executable compiled on Vista loads faster than compiled on XP
Originally Posted by wqweto
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|