473,882 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mystery: static variables & performance

I've encountered a troublesome inconsistency in the C-language Perl
extension I've written for CPAN (Digest::SHA). The problem involves the
use of a static array within a performance-critical transform function.
When compiling under gcc on my big-endian PowerPC (Mac OS X),
declaring this array as "static" DECREASES the transform throughput by
around 5%. However, declaring it as "static" on gcc/Linux/Intel
INCREASES the throughput by almost 30%.

I would prefer that the array not be "static" so that the underlying C
function will be thread-safe. However, giving up close to 30%
performance on gcc/Linux/Intel is unacceptable for a digest routine,
whose value is often closely tied to speed.

Can anyone enlighten me on this mystery, and recommend a simple, clean,
portable way to assure good performance on all host types?

TIA, Mark

Nov 14 '05
115 7679
On Sun, 15 Feb 2004 04:00:10 +0100, in comp.lang.c , Sidney Cadot
<si****@jigsaw. nl> wrote:
Mark McIntyre wrote:
Yeah, whatever. Another ottfopic nazi.


Mark,

I live in a country that suffered from Nazi occupation in WWII.
Referring to someone as a nazi in an offhand way, as you do, is quite
deeply offensive,


My apologies. It was meant to be an oblique reference to postings in this
and similar threads about the "topic nazis" that we're supposed to be round
here. Obviously I was too subtle. However IMHO you need to grow a thicker
skin if you take offense at the use of nazi in this context.

And BTW I /am/ a European. The UK is in europe too, or at least so some of
us think...
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #61
On Sun, 15 Feb 2004 01:33:07 -0700, in comp.lang.c , Mark Shelor
<ms*****@comcas t.removeme.net> wrote:
Mark McIntyre wrote:
Yeah, whatever. Another ottfopic nazi.
Make no mistake: you do not possess the comedic skills of Mel Brooks or
Jerry Seinfeld.


So sue me.
Your remark was simply mean-spirited. Do you honestly
think you won any points by such a display?


I'm not trying to win points. I'm trying to point out to you that your
behaviour is no better, and IMHO considerably worse, than the people you
are constantly attacking for being the "topic thought police" if you
prefer that term.

When you stick to making comments on C, you seem to have a clue. My advice
is to do that, and to drop the persistent drum rolls, hyperbole and snide
remarks about the regulars here.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #62
Mark McIntyre wrote:
On Sun, 15 Feb 2004 04:00:10 +0100, in comp.lang.c , Sidney Cadot
<si****@jigsaw. nl> wrote:

Mark McIntyre wrote:

Yeah, whatever. Another ottfopic nazi.
Mark,

I live in a country that suffered from Nazi occupation in WWII.
Referring to someone as a nazi in an offhand way, as you do, is quite
deeply offensive,

My apologies. It was meant to be an oblique reference to postings in this
and similar threads about the "topic nazis" that we're supposed to be round
here.


Yes, I didn't like the "topic nazis" reference either for one bit, but
at least this was coined by a non-regular, and it was used as a general
term. Your use directly pointed to Mark Shelor, which I feel takes it
one step too far.

But anyway... I'm glad you're sensible about it.
Obviously I was too subtle. However IMHO you need to grow a thicker
skin if you take offense at the use of nazi in this context.
Perhaps. On the other hand, perhaps the rest of the world could get a
bit more sensitive.
And BTW I /am/ a European. The UK is in europe too, or at least so some of
us think...


Best regards,
Sidney

Nov 14 '05 #63
Mark Shelor <ms*****@comcas t.removeme.net> scribbled the following:
Mark McIntyre wrote:
Yeah, whatever. Another ottfopic nazi.
If your purpose in using such an inflammatory term was to bring
unwarranted drama to your stunningly inconsequential post, you could
have found a far less offensive way to do it. Make no mistake: you do not possess the comedic skills of Mel Brooks or
Jerry Seinfeld. Your remark was simply mean-spirited. Do you honestly
think you won any points by such a display?


Mark, I have had enough of you. Mark already apologised for his use of
the term "Nazi", and by the way, he wasn't the first to use it in this
thread. You've been letting it be in the subject line for quite some
time yourself.
About time I did this.
*PLONK*

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"You have moved your mouse, for these changes to take effect you must shut down
and restart your computer. Do you want to restart your computer now?"
- Karri Kalpio
Nov 14 '05 #64
Joona I Palaste wrote:
Mark, I have had enough of you. Mark already apologised for his use of
the term "Nazi", and by the way, he wasn't the first to use it in this
thread. You've been letting it be in the subject line for quite some
time yourself.
About time I did this.
*PLONK*

Well, in the event your killfile manages to let this through, you may
want to check the timestamps on the messages you're referring to. Mr.
McIntyre's apology was directed to Sidney, and it was posted more than
two hours after my message. So, your use of the word "already" is a bit
baffling.

Also, I did not initiate the thread on Topic Nazis, nor did anyone in
that thread refer to me as a Nazi. Moreover, this is an unmoderated
group, so it's not up to me to either allow or disallow that term to be
used in the subject line. If you bother to check, you'll see that I
posted a response to that thread with the subject line amended to "Topic
*****". Like Sidney, I don't consider the casual use of that term to be
particularly tasteful.

It's sad that you have to use a killfile to shield yourself from the truth.

Mark

Nov 14 '05 #65
On Sun, 15 Feb 2004 06:55:50 -0700, in comp.lang.c , Mark Shelor
<ms*****@comcas t.removeme.net> wrote:
Well, in the event your killfile manages to let this through, you may
want to check the timestamps on the messages you're referring to.

You have quite a bit to learn about usenet. Its not IM you know. Theres' no
guarantee that messages arrive in order, in a timely manner, or even at
all.

Mr. McIntyre's apology was directed to Sidney, and it was posted more than
two hours after my message. So, your use of the word "already" is a bit
baffling.
FWIW I'd not seen your comment till after I replied to Sidney.
It's sad that you have to use a killfile to shield yourself from the truth.


Its sad that you can't see it. However I'm not killfiling you yet. Your C
comments sometimes make sense, and sometiems need corections, so I'm
sticking with you./
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #66
Mark McIntyre wrote:
On Sun, 15 Feb 2004 06:55:50 -0700, in comp.lang.c , Mark Shelor
<ms*****@comcas t.removeme.net> wrote:
Well, in the event your killfile manages to let this through, you may
want to check the timestamps on the messages you're referring to.


You have quite a bit to learn about usenet. Its not IM you know. Theres' no
guarantee that messages arrive in order, in a timely manner, or even at
all.

Thanks for the attention, but I think you should be delivering this
lecture to Joona I Palaste. He was the one making incorrect assumptions
about my post being made after apologies had been tendered.

Mr. McIntyre's apology was directed to Sidney, and it was posted more than
two hours after my message. So, your use of the word "already" is a bit
baffling.


FWIW I'd not seen your comment till after I replied to Sidney.

As Sidney pointed out, you aimed your use of the term "nazi" directly at
me, and I agree with Sidney that this took it one step too far. Yet,
you've offered no direct apology. The tone of your opening paragraph
signals that you're not in an apologetic mood at all. So, your FWIW is
not worth very much.

Nov 14 '05 #67
Mark McIntyre <ma**********@s pamcop.net> scribbled the following:
On Sun, 15 Feb 2004 06:55:50 -0700, in comp.lang.c , Mark Shelor
<ms*****@comcas t.removeme.net> wrote:
Well, in the event your killfile manages to let this through, you may
want to check the timestamps on the messages you're referring to.


Furthermore, in case you don't know it yet, the business with the word
"Nazi" was not the only reason I decided to killfile you, Mark Shelor.
I've fed up with you, and this was the last straw.

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"And according to Occam's Toothbrush, we only need to optimise the most frequent
instructions."
- Teemu Kerola
Nov 14 '05 #68
Mark Shelor <ms*****@comcas t.removeme.net> wrote:
So, it's not quite fair to say that this newsgroup has the same
relation to the C language that a Star Trek convention does to rocket
science. But it IS demonstrably less helpful than newsgroups for other
languages such as Perl.
Demonstrably? Well, then, please demonstrate this - taking into account
the fact that I find this the most helpful computing group I know, and
the less so the more system-specific posts there are.
Perhaps one thing we could agree on is C's desirability and aptness for
system implementation in general. Why not contribute to serving that
end?


We do. Note - "in general", not "for Windows XP SP3 only".

Richard
Nov 14 '05 #69
On Sun, 15 Feb 2004 21:12:30 -0700, in comp.lang.c , Mark Shelor
<ms*****@comcas t.removeme.net> wrote:
Mark McIntyre wrote:

Thanks for the attention, but I think you should be delivering this
lecture to Joona I Palaste. He was the one making incorrect assumptions
about my post being made after apologies had been tendered.
eh? Your own text, quoted below, makes it clear that you have some problems
w/ the concept.
Mr. McIntyre's apology was directed to Sidney, and it was posted more than
two hours after my message. So, your use of the word "already" is a bit
baffling.

you've offered no direct apology.


I did.
The tone of your opening paragraph
signals that you're not in an apologetic mood at all. So, your FWIW is
not worth very much.


*shrug*. YMMV but frankly I begin to think you're a troll.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #70

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

109
4215
by: MSG | last post by:
Michel Bardiaux <michel.bardiaux@peaktime.be> wrote in message news:<G4idnfgZ0ZfCWbrdRVn2jQ@giganews.com>... > Mark Shelor wrote: > > > > > OK, Sidney, I am considering it. I can certainly understand the premise > > that a group might choose to entertain ONLY those questions that can be > > resolved purely by a reading or clarification of (drum roll please) The > > Standard. But how utterly boring, and what a waste of talent. It > >...
0
9931
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9777
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11108
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10725
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7113
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5781
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5978
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4601
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.