vbGore Free Online RPG Engine

Revolutionizing Visual Basic ORPG Development
It is currently Wed Jun 19, 2013 5:00 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Compiling Options
PostPosted: Mon Jun 18, 2007 1:10 pm 
5th Dimension Prisoner

Joined: Mon Jun 18, 2007 2:16 am
Posts: 214
I read through the "Understanding Visual Basic" section on the site and I got to messing around. Here's what I found:

Compile to P-Code.
When I used this option my program compiled within 1 second and the executable size dropped by almost 200kb (360 to 188).

When I used Compile to Native Code > Optimise for Fast Code it took around 3-4 seconds to compile and the executable size was 360kb.

What is that option removing to make the program so lean and what is P-Code?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 18, 2007 4:25 pm 
=^.^= Kitty =^.^=

Joined: Tue Mar 20, 2007 10:46 pm
Posts: 1821
Location: Sydney Australia
P-Code just stands for "Packed Code", its an alternate method for compiling, it aims on making really small programs...

I use P-Code often if my code in Native crashs.


I'm not sure how Native Code works, but from what I understand it attemps on minimizing the use of DLL libraries by including more of the code within the program from the DLL, so it speeds it up in a way - but it still requires the use of linkage to the library.

Also there is a difference between P-Code and Native Code... P-Code remains as a "high level" programming, thus the computer must work on interpretting it with more effort, where as native code has already been interpretted, therefore the computer does not need to do as much work on it...

Of course I could be completely wrong here :P


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 18, 2007 5:04 pm 
Site Admin

Joined: Fri Jul 14, 2006 4:00 pm
Posts: 11230
Location: Washington
P-Code compiles so fast in comparison to Native Code since without all the optimizations ticked in Native Code, it has a lot more to write. The optimizations in Native Code actually remove features.

You never want to use P-Code unless using Native Code isn't an option. Most of the time this will never be the case, unless you're doing something pretty advanced.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 18, 2007 8:49 pm 
5th Dimension Prisoner

Joined: Mon Jun 18, 2007 2:16 am
Posts: 214
Alright. I read up on it after your posts and I found this for anyone else that has the same question:

P-Code stands for 'pseudo code'. When a program is compiled to P-Code, an interpreter is used (loaded into memory along with the executable) whereas in Native Code one is not (thus the larger file size).

P-Code may compile fast and into small file sizes but if you're going for fast code this isn't the option to use. It's also an alternative for packaging and deployment.

Compiling to Native Code > Optimise for Fast Code gives you the best results in terms of program that executes faster than the other options but the downfall is large file sizes. This option is mainly suited for those with large programs that are being distributed through a high speed connection (Cable/LAN) or on CD.

Compiling to Native Code > Optimise for Small Code gives you a slightly smaller file size intended for internet distribution but executes slower than Optimise for Fast Code.

Compile To Native Code > No Optimizations means just that - you get no optimizations. With compilers and optimizations, you never know what you're going to get. It's a win/lose, basically. If it works, great - if not, oh well. If you're returned errors when using Advanced Optimizations, using this option would be ideal. Be aware that your file size will be the largest with this option.

Create Symbolic Debug info. This option I have no clue about. It creates a debug file (obviously) associated with your executable when compiled but I have no idea how to access it or what it has in it (probably debug information, lol).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group