dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: HUGE compile time not understood

  1. #1
    Join Date
    Aug 2001
    Posts
    1,447

    HUGE compile time not understood

    I have a monstrous string-pair list that I want do embed in my code, so I wrote a program to convert it from a 700KB text file to a series of 14 modules (each of which has to be under 64K when compiled) that assign the pairs to a sequential set of array values. When I then run the program, using the "run with full compile" the compilation takes a couple of seconds and everything works fine. When I attempt to create an EXE file the compile takes so long and is so massively CPU intensive that it actually causes my Toshiba laptop to overheat and shut down. The creation process insists on creating object files (.OBJ) for each of the modules and I've never made it past creating 6 of the 14 OJB files before the computer shuts down and just that much takes about 10 minutes. It's just ridiculous!!! The size and content of the OBJ files are also quite silly --- they are far bigger than the text strings they contain by at least double

    So the question is, since the inline compile is so fast, why does the EXE creation take approximately forever??? And even more to the point, is there anything I can DO about it? Just reading the text file only takes a couple of seconds, so I can use that if I have to but I wanted to avoid the extra file. I can't see that a resource file buys me anything in this case, so it's embed (which is what this question is about) or just stick with the text file.

    Thanks,
    phinds
    vs2008, 3.5SP1 Version 9.0.21022.8 RTM

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: HUGE compile time not understood

    Sounds like other problems on the laptop, sorry to say. Post the code here, and someone will compile it for you (prolly thru email).
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    May 2004
    Location
    45,000FT Above Nevada
    Posts
    1,539

    Re: HUGE compile time not understood

    Quote Originally Posted by dglienna
    Sounds like other problems on the laptop, sorry to say. Post the code here, and someone will compile it for you (prolly thru email).
    Send it to David..he is a wizard on VB...
    Jim
    ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII

    "The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.

    "Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.

  4. #4
    Join Date
    Aug 2001
    Posts
    1,447

    Re: HUGE compile time not understood

    I appreciate the suggestion, but the laptop issue is irrelevant except inasmuch as it prevents the compile, which is not the only thing that causes the laptop to overheat. The issue for me is that I don't understand why the VB environment wants to create these huge OBJ files and why it takes such a HUGE amount of time to do so.
    phinds
    vs2008, 3.5SP1 Version 9.0.21022.8 RTM

  5. #5
    Join Date
    Aug 2006
    Posts
    145

    Re: HUGE compile time not understood

    Quote Originally Posted by phinds
    So the question is, since the inline compile is so fast, why does the EXE creation take approximately forever???
    I haven't got a solution to the problem, but in answer to this, when running a program within the IDE the code it is compile to p[seudo]-code. This intermediatry language allows all the funky run-time debugging stuff whilst the app runs in a faux-exe state.
    The exe is usually (by default) compiled to native code which is obviously going to be a lot more effort to do (for the computer) - but the resulting code runs much faster. p-code and native code even behave differently - error handling being one example.

    Perhaps try compiling your exe to p-code (Compile tab of project properties) - you'll loose some speed, but at least you'll actually get an exe... (maybe)

  6. #6
    Join Date
    Nov 2004
    Location
    Lincoln, NE
    Posts
    516

    Re: HUGE compile time not understood

    Will it let you add it as a resource and load your array out of code? I can't imagine that assigning 700K values in 14 modules will give you any sort of benefit (other than warmth radiating from a laptop on a cold night...)

  7. #7
    Join Date
    Aug 2001
    Posts
    1,447

    Re: HUGE compile time not understood

    Bushmobile, you are obviously correct and I should have stated that I was aware of exactly what you said. My question is really why it takes so LONG to do the compile and whether there's any way around it. I've copiled lots of programs in lots of languages and I have NEVER seen simple string compilation take such an inordinately large amount of time.

    Comintern, I'm going to try a resource file since that may be the solution to the compile time issue and also solve the problem that I really started off trying to solve which is to avoid ancilliary files such as the text file. If it DOES compile lots faster than the separate-modules solution, I will be happy but still puzzled.

    I am also puzzled as to why the OBJ files are so ridiculously large. There again, I've done lots of compiles in lots of languages and and have never seen such silly OBJ files

    Thanks both ...
    phinds
    vs2008, 3.5SP1 Version 9.0.21022.8 RTM

  8. #8
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: HUGE compile time not understood

    Maybe the OBJ files hold the string data in Unicode, thus doubling the size...
    (just a thought)

  9. #9
    Join Date
    Aug 2001
    Posts
    1,447

    Re: HUGE compile time not understood

    good thought --- doesn't SEEM to be the case but maybe so and a reasonable idea in any case. Still does't explain the huge compile time.
    phinds
    vs2008, 3.5SP1 Version 9.0.21022.8 RTM

  10. #10
    Join Date
    May 2004
    Location
    45,000FT Above Nevada
    Posts
    1,539

    Re: HUGE compile time not understood

    Quote Originally Posted by phinds
    good thought --- doesn't SEEM to be the case but maybe so and a reasonable idea in any case. Still does't explain the huge compile time.
    Just curious...can you post one of the modules and someone else can copy it 13 times and try to compile it in their code and see if it does the same thing ???

    Just a thought..
    Jim
    ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII

    "The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.

    "Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.

  11. #11
    Join Date
    Aug 2001
    Posts
    1,447

    Re: HUGE compile time not understood

    and an excellent thought it is --- I'll do it but it will have to wait a bit since I deleted both the modules and the code that created them --- not hard to redo but I'm off on errands for the moment
    phinds
    vs2008, 3.5SP1 Version 9.0.21022.8 RTM

  12. #12
    Join Date
    Aug 2001
    Posts
    1,447

    Re: HUGE compile time not understood

    OK, I've ZIPed up one module, attached, with comments at the top showing what needs to be done.

    If someone could dupe this module as directed and see how the compile goes, and whether or not you get corresponding OBJ files that are about double the size of each module, I would really appreciate it.

    Thanks.
    Attached Files Attached Files
    phinds
    vs2008, 3.5SP1 Version 9.0.21022.8 RTM

  13. #13
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: HUGE compile time not understood

    The first line of the copied module (mod2) :
    Code:
    daBOT(0).c = "a black wattle"
    is INVALID OUTSIDE PROCEDURE

    Here's what it looks like:

    Code:
    Option Explicit
    '
    ' COMPILE THE WHOLE THING AND SEE HOW LONG IT TAKES AND WHETHER OR NOT "OBJ" FILES ARE
    ' CREATED WHICH ARE EACH ABOUT DOUBLE THE SIZE OF THIS BAS FILE
    '
    '
    daBOT(0).c = "a black wattle": daBOT(0).b = "acacia mabellae"
    I don't see why you'd want to redefine all of the names, unless that they are different in each module. I still think that you could only keep one module's data in memory. Who need 25K * 15 different names?
    Last edited by dglienna; October 29th, 2006 at 11:43 AM.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  14. #14
    Join Date
    Aug 2001
    Posts
    1,447

    Re: HUGE compile time not understood

    yeah, sorry, you have to make the array definition global or the other modules won't see it. I only attached one of 14 DIFFERENT modules, each of which have a set of data values but still stay under 64K at compile time (which they MUST) but which taken in total, define 20,000 data pairs.
    phinds
    vs2008, 3.5SP1 Version 9.0.21022.8 RTM

  15. #15
    Join Date
    Aug 2001
    Posts
    1,447

    Re: HUGE compile time not understood

    If anyone out there could follow this thread (especially the last few entries) & do a test compile & let me know the results, I'd really appreciate it. Thanks.
    phinds
    vs2008, 3.5SP1 Version 9.0.21022.8 RTM

Page 1 of 2 12 LastLast

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)