Re: Native Code vs PCode



I guess you haven't seen any of the previous threads on this subject, e.g.
http://groups.google.ie/group/microsoft.public.vb.general.discussion/browse_frm/thread/0d579a81dc11e19c/117fe49d249e3c8a?hl=en#117fe49d249e3c8a

The point being that P-code is interpreted rather than being converted to
native code via a JIT compiler

Tony Proctor

"M. Posseth" <MPosseth@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:33DEBA46-0AAB-4FDE-BDF2-D25993AD2C82@xxxxxxxxxxxxxxxx
> 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)
> >


.



Relevant Pages

  • Re: VB6 creates HUGE executable
    ... Compiling Your Project to Native Code ... compile your code either in standard Visual Basic p-code format or in native ... and debugging that aren't available with p-code. ...
    (microsoft.public.vb.general.discussion)
  • Re: Compiled, Tokenized or Interpreted?
    ... the tokenized and interpreted nature of VBA. ... VB Classic (which is the development environment this group supports) can be ... Here's a page that discusses compiling to native code. ...
    (microsoft.public.vb.general.discussion)
  • Re: Strange stuff
    ... Try compiling to pcode rather than native code. ... Please respond only to the newsgroups so all can benefit. ... "Jim Carlock" wrote in message ...
    (microsoft.public.vb.general.discussion)
  • Re: C++/CLI is the way to go
    ... you are mixing different object models in your assembly when compiling with /clr or /clr:pure. ... The compiler will throw a warning if native code is generated, by default it does not generate mixed code, without warning. ... No what you are after is "deterministic" destruction PLUS deterministic finalization, and this is the whole point of the discussion. ... The discussion is about automating destruction of managed types, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Native Code vs PCode
    ... situations (p-code, native code with and without the different optimization ... >> code format. ... By compiling directly to native code ...
    (microsoft.public.vb.general.discussion)