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
chee68Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.