[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

P-code and Native Code

Hi,

What is the significant diference between P-code and Native code.  Which one is better in terms of performance?  Why?  Which code is recommanded?

Thanks

chee
0
chee68
Asked:
chee68
1 Solution
 
MarineCommented:
P-code EXE size is smaller but has speed drawback,native code allows you additional optimization and about 20 times faster then compiling to P-code
0
 
halapayaCommented:
native code is better.

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.

so.. if u choose p-code; ut again converts each line of ur code to native code , before executing.

but native code... this intermediate converting of line by line is not happening.. thus good performance. cause at compile time it directly compile to native code.

Compiling a project with the Native Code option will fully compile ur proggy 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 virtual machine.

so recomended is p-code.

0
 
halapayaCommented:
native code is better.

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.

so.. if u choose p-code; ut again converts each line of ur code to native code , before executing.

but native code... this intermediate converting of line by line is not happening.. thus good performance. cause at compile time it directly compile to native code.

Compiling a project with the Native Code option will fully compile ur proggy 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 virtual machine.

so recomended is p-code.

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
MarineCommented:
i guess you made a type Native Code is better better optimization.
0
 
halapayaCommented:
opppsssssssss :o)
RECOMENDED IS NATIVE CODE... NOT PCODE..
darn.. these guys will kill me for that :o) SORRRYYYY :o)
0
 
smeggheadCommented:
MicroSoft must have had a reason to include p-code, what are the advantages of it ?? is it more portable ? i.e. will it run on Alpha as opposed to x86 or on a ZX81 ???

Smeggy Smeggster.
0
 
Jeremy_DCommented:
p-code is indeed more portable than native code, which is one advantage (It should even run on a Z-80 processor provided you can find a VB p-code interpreter for that ;-).
Another one is that the executable size is a lot smaller.
Yet another is that your compile time is a lot shorter.
0
 
VbmasterCommented:
Actually p-code CAN be faster than native code, but in most cases the native code is faster. I read somewhere that if you do a lot of  databases access can get better performance using p-code. Don't know why but this was the case.

Don't forget the "advanced settings" when you compile, they can really give you some great performance boosts. ;)
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now