Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: phvckmeh on October 09, 2004, 07:46 PM

Title: VB: P-Code OR Optimized Code (when compileing)
Post by: phvckmeh on October 09, 2004, 07:46 PM
This is based on what i know

P-Code
Pros: Smaller EXE Files, Less memory usage

Optimized code
Pros: Faster code?
Cons: More memory usage (so its accutally slower)

I dont know which do use...
Title: Re: VB: P-Code OR Optimized Code (when compileing)
Post by: UserLoser. on October 09, 2004, 07:59 PM
Quote from: forum.valhallalegends.com
Battle.net Bot Development

Quote from: You
A post un-related to Battle.net Bot Development
Title: Re: VB: P-Code OR Optimized Code (when compileing)
Post by: phvckmeh on October 09, 2004, 08:12 PM
Quote from: UserLoser on October 09, 2004, 07:59 PM
Quote from: forum.valhallalegends.com
Battle.net Bot Development

Quote from: You
A post un-related to Battle.net Bot Development

Yeah im compiling my bot, and i wonder which would be better
Title: Re: VB: P-Code OR Optimized Code (when compileing)
Post by: BaDDBLooD on October 09, 2004, 08:23 PM
Wouldn't that depend if it was Ops, Chat, Annoying Flood/Mass Bot?
Title: Re: VB: P-Code OR Optimized Code (when compileing)
Post by: Yoni on October 09, 2004, 08:28 PM
Don't use P-Code; that's all there is to it.
Title: Re: VB: P-Code OR Optimized Code (when compileing)
Post by: phvckmeh on October 09, 2004, 08:34 PM
Quote from: Yoni on October 09, 2004, 08:28 PM
Don't use P-Code; that's all there is to it.

Any reasons why? It seems to be faster+more stable when i use it, also half the exe size and half the ram usage.....
Title: Re: VB: P-Code OR Optimized Code (when compileing)
Post by: Tuberload on October 09, 2004, 08:48 PM
The whole point of pcode is to shrink the executable size. The fact that VB requires a few megs in dependencies kind of makes that a waste IMO.
Title: Re: VB: P-Code OR Optimized Code (when compileing)
Post by: BaDDBLooD on October 09, 2004, 09:09 PM
Quote from: Tuberload on October 09, 2004, 08:48 PM
The whole point of pcode is to shrink the executable size. The fact that VB requires a few megs in dependencies kind of makes that a waste IMO.

Atleast it makes all the dumb people think your app is small ^_^
Title: Re: VB: P-Code OR Optimized Code (when compileing)
Post by: OnlyMeat on October 09, 2004, 09:15 PM
Quote from: phvckmeh on October 09, 2004, 07:46 PM
This is based on what i know

P-Code
Pros: Smaller EXE Files, Less memory usage

Optimized code
Pros: Faster code?
Cons: More memory usage (so its accutally slower)

I dont know which do use...

P-Code = pseudo code = interpreted at runtime = slower than native code.

It's as simple as that.
Title: Re: VB: P-Code OR Optimized Code (when compileing)
Post by: phvckmeh on October 09, 2004, 10:44 PM
Well personaly the p-code has been running better, i get faster startup times, and it uses about 4 megs less ram...
Title: Re: VB: P-Code OR Optimized Code (when compileing)
Post by: Puzzle on October 10, 2004, 05:00 AM
Why would your bot use more than 4 to begin with?
Title: Re: VB: P-Code OR Optimized Code (when compileing)
Post by: Grok on October 10, 2004, 09:33 AM
There are times you will want to use p-code.  VB sometimes gets weird errors (application exceptions) on otherwise harmless-looking lines of code when it is compiled to machine code.  If you recompile it to p-code, those errors go away.  So the machine code compiler for VB is not perfect.  I write enough code that I see this condition once every 3-4 months.
Title: Re: VB: P-Code OR Optimized Code (when compileing)
Post by: phvckmeh on October 10, 2004, 10:40 AM
Quote from: Puzzle on October 10, 2004, 05:00 AM
Why would your bot use more than 4 to begin with?

:) it went from 6.3megs to 2.4