[news.software.b] C-news and SCO Xenix 2.3.3

syd@dsinc.DSI.COM (Syd Weinstein) (04/24/91)

Finally had time to track down a problem with C News and SCO Xenix 2.3.3.
Thanks Geoff for putting up with my problem reports, but it did take
a long time to figure out...

Symptom:

relaynews takes 15+ cpu seconds to get started, then runs very fast
thereafter.

After much profiling found that the problem was in loading the active
file.  Traced it to strchr.  It appears that SCO's strchr is probably
doing a strlen first then the search for the character.  Works ok
on short strings.  Works lousey on the entire active file when using
strchr to find the newlines and break it apart.

Reconfigured C-news to use the fake (supplied) strchr and its friends.

Now it starts in .1 cpu seconds or less and works like a charm.

Solution:
If you are running SCO Xenix, tell build you don't have strchr and all
of its friends even though you do.
-- 
=====================================================================
Sydney S. Weinstein, CDP, CCP                   Elm Coordinator
Datacomp Systems, Inc.                          Voice: (215) 947-9900
syd@DSI.COM or dsinc!syd                        FAX:   (215) 938-0235

ronald@robobar.co.uk (Ronald S H Khoo) (04/29/91)

[ discussion widened, because it's generally relevant.  please edit followups ]

syd@DSI.COM writes:

> Finally had time to track down a problem with C News and SCO Xenix 2.3.3.

This problem is probably far more generic than it wants to be.  The strchr
in all the SCO development systems I have to hand is the same
(that's versions 2.2.0b 2.3.0d 2.3.1b 3.2.0f) and is an assembly coded
version of (approximately)

	char *strchr(char *s, c) { return memchr(s, c, strlen(s)); }

This is only slower than Henry's fake where the match is significantly
earlier than the length of the string, and this is only of material
consequence[*] in that single strchr in active.fast.c.

Unfortunately, I have seen this algorithm for strchr in other places,
especially where memchr() is fast.  So, if relaynews takes more than
a second or so to run for a single article, this is worth examining,
I guess.  Sigh.

Geoff & Syd:  Matthew's CPU thanks you -- it was running out of cycles.

------
[*] as far as relaynews is concerned, anyway.
-- 
Ronald Khoo <ronald@robobar.co.uk> +44 81 991 1142 (O) +44 71 229 7741 (H)

jpr@jpradley.jpr.com (Jean-Pierre Radley) (04/30/91)

In article <1991Apr24.030223.7753@DSI.COM> syd@DSI.COM writes:
>Finally had time to track down a problem with C News and SCO Xenix 2.3.3.
>Symptom:
>
>relaynews takes 15+ cpu seconds to get started, then runs very fast
>thereafter.
>
>
>Reconfigured C-news to use the fake (supplied) strchr and its friends.
>
>Now it starts in .1 cpu seconds or less and works like a charm.
>
>Solution:
>If you are running SCO Xenix, tell build you don't have strchr and all
>of its friends even though you do.


Same advice if running SCO Unix 3.2 ?
Does using O'Keefe's strings library help?

Jean-Pierre Radley   Unix in NYC   jpr@jpr.com   jpradley!jpr   CIS: 72160,1341

dylan@ibmpcug.co.uk (Matthew Farwell) (05/02/91)

In article <1991Apr29.160721.1854@robobar.co.uk> ronald@robobar.co.uk (Ronald S H Khoo) writes:
> [ fix deleted ]

It does have a significant effect. incoming processing is now 3
or 4 times faster.

>Geoff & Syd:  Matthew's CPU thanks you -- it was running out of cycles.

Yeah, Thanks. Can you do anything about my slow disks as well now please?

Dylan.
-- 
Matthew J Farwell: dylan@ibmpcug.co.uk || ...!uunet!ukc!ibmpcug!dylan
Welcome back my friends, to the show that never ends, we're so glad
            you could attend, come inside, come inside!!!

henry@zoo.toronto.edu (Henry Spencer) (05/02/91)

In article <1991May2.045757.10163@ibmpcug.co.uk> dylan@ibmpcug.CO.UK (Matthew Farwell) writes:
>>Geoff & Syd:  Matthew's CPU thanks you -- it was running out of cycles.
>
>Yeah, Thanks. Can you do anything about my slow disks as well now please?

We could help you take an axe to them...
-- 
And the bean-counter replied,           | Henry Spencer @ U of Toronto Zoology
"beans are more important".             |  henry@zoo.toronto.edu  utzoo!henry