p-code vs binary compile

227 views
Skip to first unread message

clipper6

unread,
Feb 16, 2014, 10:41:45 PM2/16/14
to harbou...@googlegroups.com
When I was very new with HB I was thinking that it was binary compiled but later on I learned that it was p-code compiled. My question is why binary compile was not chosen but instead it still opted to p-code compile?

Angel Pais

unread,
Feb 17, 2014, 7:04:50 PM2/17/14
to harbou...@googlegroups.com
PCODE is more compact and portable


2014-02-17 1:41 GMT-02:00 clipper6 <arl...@gmail.com>:
When I was very new with HB I was thinking that it was binary compiled but later on I learned that it was p-code compiled. My question is why binary compile was not chosen but instead it still opted to p-code compile?

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
 
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

clipper6

unread,
Feb 17, 2014, 7:30:37 PM2/17/14
to harbou...@googlegroups.com
Would it not make Harbour slower since it would be interpreted?

Klas Engwall

unread,
Feb 17, 2014, 8:48:37 PM2/17/14
to harbou...@googlegroups.com
Hi clipper6,

> Would it not make Harbour slower since it would be interpreted?

Do you find it slow?

My stock report, 29 tightly printed pages, starts and finishes within
the same second when running locally on the server with no network
overhead. I think that is pretty quick.

Regards,
Klas

clipper6

unread,
Feb 17, 2014, 9:06:22 PM2/17/14
to harbou...@googlegroups.com
I could not really say for myself if it's slow or fast because I'm just starting to use it. Thanks for the feedback though. I'm using this now for production in my company. I'm introducing my company to FOSS and I don't want to be embarrassed regarding any performance issue. I'm using HB to develop a CGI web app. As soon as I know how, I will convert it to fastcgi.

Przemyslaw Czerpak

unread,
Feb 18, 2014, 2:42:06 AM2/18/14
to harbou...@googlegroups.com
Hi,

Harbour can generate machine code instead of PCODE with -gc3
switch. It's ~10%-20% faster but only if no other slow functions
are executed. Just pure PRG code only. The size of final binaries
are about 4-5 times bigger.
BTW PCODE is not interpreted. PCODE is evaluated and the difference
is fundamental for the speed. Unlike many people think and said on
public forums Clipper and Harbour are compilers. Even hbrun
executing PRG code is compiler. Interpreter is completely different
animal. Early versions of Ron's xBase Script were interpreters.
Current ones are mix of compiler and interpreter.

best regards,
Przemek



On Mon, 17 Feb 2014, clipper6 wrote:
> Would it not make Harbour slower since it would be interpreted?
>
> On Tuesday, February 18, 2014 8:04:50 AM UTC+8, Angel Pais wrote:
> >
> > PCODE is more compact and portable
> >
> >
> > 2014-02-17 1:41 GMT-02:00 clipper6 <arl...@gmail.com <javascript:>>:
> >
> >> When I was very new with HB I was thinking that it was binary compiled
> >> but later on I learned that it was p-code compiled. My question is why
> >> binary compile was not chosen but instead it still opted to p-code compile?
> >>
> >> --
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Harbour Users" group.
> >> Unsubscribe: harbour-user...@googlegroups.com <javascript:>
> >> Web: http://groups.google.com/group/harbour-users
> >>
> >> ---
> >> You received this message because you are subscribed to the Google Groups
> >> "Harbour Users" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an
> >> email to harbour-user...@googlegroups.com <javascript:>.

Daniele Campagna

unread,
Feb 18, 2014, 3:20:24 AM2/18/14
to harbou...@googlegroups.com
Il 18/02/2014 03:06, clipper6 ha scritto:
> I could not really say for myself if it's slow or fast because I'm
> just starting to use it. Thanks for the feedback though. I'm using
> this now for production in my company. I'm introducing my company to
> FOSS and I don't want to be embarrassed regarding any performance
> issue. I'm using HB to develop a CGI web app. As soon as I know how, I
> will convert it to fastcgi.
>
OF COURSE a p-code based program is a bit slower than a pure binary one.
But you must consider that hardly you will be using Harbour to create a
chess engine or some other cpu-intensive program. With modern computers
and doing database-oriented programs, you will never notice any
performance problem. Harbour CGIs in my experience are ultra-fast and
quite small. Under Linux or Windows a modern hardware runs them as a breeze.
Regards,
Dan

Lorenzo Fiorini

unread,
Feb 18, 2014, 12:18:20 PM2/18/14
to harbou...@googlegroups.com
On Tue, Feb 18, 2014 at 3:06 AM, clipper6 <arl...@gmail.com> wrote:
I could not really say for myself if it's slow or fast because I'm just starting to use it. Thanks for the feedback though. I'm using this now for production in my company. I'm introducing my company to FOSS and I don't want to be embarrassed regarding any performance issue. I'm using HB to develop a CGI web app. As soon as I know how, I will convert it to fastcgi.

Most of the widely used web languages like Java, .Net, PHP, Perl, Python, Ruby are interpreted or pcoded.

In web applications the bottlenecks are in the network and data access layers so a "super fast language" doesn't make any real difference.
Moreover CGI's process overhead, could have been a problem with the 486/586, but a modern CPUs with 6/8 cores HT can serve a lot of users with the necessary bandwidth.

best regards,
Lorenzo

clipper6

unread,
Feb 21, 2014, 12:03:50 AM2/21/14
to harbou...@googlegroups.com
Thanks.
Reply all
Reply to author
Forward
0 new messages