Re: Native Code vs PCode
- From: "M. Posseth" <MPosseth@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 2 Sep 2005 02:54:12 -0700
If you have the Professional or Enterprise edition of Visual Basic, you can
compile your code either in standard Visual Basic p-code format or in native
code format. Native code compilation provides several options for optimizing
and debugging that aren't available with p-code.
P-code, or pseudo code, is an intermediate step between the high-level
instructions in your Basic program and the low-level native code your
computer's processor executes. At run time, Visual Basic translates each
p-code statement to native code. By compiling directly to native code format,
you eliminate the intermediate p-code step.
You can debug compiled native code using standard native code debugging
tools, such as the debugging environment provided by Visual C++. You can also
use options available in languages such as Visual C++ for optimizing and
debugging native code. For example, you can optimize code for speed or for
size.
Note All projects created with Visual Basic use the services of the
run-time DLL (MSVBVM60.DLL). Among the services provided by this DLL are
startup and shutdown code for your application, functionality for forms and
intrinsic controls, and run-time functions like Format and CLng.
Compiling a project with the Native Code option means that the code you
write will be fully compiled to the native instructions of the processor
chip, instead of being compiled to p-code. This will greatly speed up loops
and mathematical calculations, and may somewhat speed up calls to the
services provided by MSVBVM60.DLL. However, it does not eliminate the need
for the DLL.
regards
Michel Posseth [MCP]
"Tom Esh" wrote:
> On Fri, 2 Sep 2005 08:15:42 +0200, "Ivan Debono"
> <ivanmdeb@xxxxxxxxxxx> wrote:
>
> >Hi all,
> >
> >I've got some activex dlls that access a database, retrieve recordsets, loop
> >through them, calculate stuff, etc...
> >
> >Would it make a big difference if I compiled to PCode instead of Native Code
> >(Fast Code)??
> >
> >The difference is in the size which is important for me as I need to package
> >everything in a setup file and make it available on the internet for
> >downloading.
>
> Very unlikely you would see much improvement with native unless you're
> doing a ~lot~ of calculations. It's easy enough to build & test each
> way though if you want to be certain.
>
> -Tom
> MVP - Visual Basic
> (please post replies to the newsgroup)
>
.
- Follow-Ups:
- Re: Native Code vs PCode
- From: Tony Proctor
- Re: Native Code vs PCode
- References:
- Native Code vs PCode
- From: Ivan Debono
- Re: Native Code vs PCode
- From: Tom Esh
- Native Code vs PCode
- Prev by Date: Re: Why dll Form disappears immediately?
- Next by Date: Re: Syntax to QUIT the running App - To Clarify...
- Previous by thread: Re: Native Code vs PCode
- Next by thread: Re: Native Code vs PCode
- Index(es):
Relevant Pages
|