> > xHarbour version: 1,089,536 bytes Harbour Version: 2,174,048I've just been using this thread for about a week. Could not find
> > bytes !
>
> This has been answered just recently, you may
> want to look up the thread here.
the post relating executable to size (used the search box at the top
with no result except your post above)
Ignoring all the questions Viktor has already answered ...
> I hit the <tab> and <enter> again and screwed up the post :((( (This
> is SO different from posting on thhe comp.lanf.xharbour group.
[...]
> Please excuse my using the <Tab><enter> and posting when I wasn't
> ready. (How can I stop this ?!?)
You are posting online at Google Groups, right? You can configure your
Google Groups account to forward all messages to your email account (I
set up a separatate account for this). Then you can use your familiar
email client to read and write mailing list messages locally. In
Thunderbird I set up a separate profile in a separate directory to keep
the mailing list from mixing with all the other emails. It works
perfectly for me.
Regards,
Klas
CCH said:
> CCH : Try http://cch4clipper.blogspot.com/2011/03/does-smaller-exe-size-equates...
--
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
> Yes, I run three web sites from my server -- all currently using
> xHarbour. But, I've been testing the 'small' site with Harbour. That
> is the one I'll start with !
>
> Thanks for your guidance. I'll let you know when I've got my cgi app
> ready to run under harbour with a .dll.
Seems interesting...
I would like to see a working example, if possible, of course.
Thank you.
Qatan
Hi Mel and Viktor,
> It's pretty hard to advise anything. First you need to decide
> what is more important, speed or size (memory consumption).
In this particular case the test measure the speed of NTOC() function
which consume over 95% of CPU time. Both compilers uses nearly the same PRG
implementation of this function which is also rather inefficient.
It can be improved very strongly by simple rewriting in C. Even small
improvements at PRG level gives ~20% time reduction.
The xHarbour version is a little bit shorter because it's not fully
CT3 compatible. The Harbour version has few fixes which added additional
code and reduced the speed. The second reason of speed reduction is overhead
caused by MT HVM which is now default in Harbour shared (harbour*.dll) library.
Both compilers optimize += operator for strings so this operation costs nearly
nothing though here please remember that Harbour optimizes all
<exp1> += <exp2>
operations but xHarbour only expression where <exp1> is LOCAL variable or indexed
array. Try tests/speedstr.prg to see it in real life.
This test can also show you the overhead in current Harbour versions produced by
MT mode and -shared switch.
Mel, if you replace in your test NTOC() with STR() then you will eliminate overhead
produced by this functions. If you also link your code statically then you will eliminate
overhead introduced by MT HVM. This should give more realistic results for comparison.
BTW does anyone want to rewrite NTOC() and corresponding functions in C?
> Lately, we've been (or at least I have been) talking about
> memory consumption. Which is supposed to be eased
> by -shared mode. At the same time -shared mode has
> at least two kinds of overhead compared to -static:
> 1) it has to load the .dll (from cache, but anyway), it
> has to bind it, etc
> 2) harbour .dll is by default built in MT, and MT mode
> has some overhead compared to ST.
> +1) 2) on some platforms (*nix) it has extra overhead because of PIC
> (position independent code) mode
>
> Which means, if your goal is sheer speed with your number of
> users, probably -static is a better option ATM.
Programs linked dynamically register in HVM all functions present in harbour
shared library. This registration also takes some time so if the same application
is executed thousands of times then summary overhead is noticeable. BTW I'll improve
startup registration code ASAP but still static binaries will have less symbol to
activate so they will be faster.
> [ If you wish to optimize on both, you may try generating
> ST harbour .dll, though for this I'll first commit a change
> to revert this option to usable state. ]
Viktor, I would like to ask you to restore support for different HVMs in shared libraries.
I plan to add support for serialized threads like in xBase++ or PYTHON.
It will give item write protection so it'll be save for internal HVM structures to write
to the same complex item by different HVM threads. It's not real MT mode but looks that
xBase++ and PHYTON users can leave with it and for sure it greatly helps to port existing
xBase++ code which does not use any protection to Harbour. Also some libraries which are
not MT ready will work correctly which such MT model in HVM.
Anyhow it means that we will have yet another HVM library and potentially harbour*.dll
for user who will want to use such HVM in shared mode.
best regards,
Przemek