By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,480 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,480 IT Pros & Developers. It's quick & easy.

Zero Optimization and Sign Optimization???

P: n/a
Hi Friends,

I wanted know about whatt is ment by zero optimization and
sign optimization and its differences....
Thank you...


Nov 17 '08 #1
Share this Question
Share on Google+
20 Replies


P: n/a
On 17 Nov, 08:42, Ravikiran <ravisattig...@gmail.comwrote:
* * * * *I wanted know about whatt is ment by zero optimizationand
sign optimization and its differences....
optimisation techniques are not on-topic for comp.lang.c.
Try comp.programming or a compiler group or just google it.

--
Nick Keighley
Nov 17 '08 #2

P: n/a
On Nov 17, 8:42*am, Ravikiran <ravisattig...@gmail.comwrote:
Hi Friends,

* * * * *I wanted know about whatt is ment by zero optimizationand
sign optimization and its differences....
Whenever my company outsources programming jobs they specify in the
contract how much optimisation is required. "Zero optimisation" means
code that works, without being optimised. If we want optimisations,
then someone in management has to sign because of the additional cost,
so there is always a space left in the contract marked "Sign
optimisation" where someone can sign to require optimisation.

The differences between "sign optimisation" and "zero optimisation"
can be many thousands in cost, plus delays in development of weeks, or
even months.
Hope this answers your question.

Nov 17 '08 #3

P: n/a
"christian.bau" wrote:
Ravikiran <ravisattig...@gmail.comwrote:
>I wanted know about whatt is ment by zero optimization and sign
optimization and its differences....

Whenever my company outsources programming jobs they specify in
the contract how much optimisation is required. "Zero
optimisation" means code that works, without being optimised. If
we want optimisations, then someone in management has to sign
because of the additional cost, so there is always a space left
in the contract marked "Sign optimisation" where someone can sign
to require optimisation.

The differences between "sign optimisation" and "zero
optimisation" can be many thousands in cost, plus delays in
development of weeks, or even months.
Nonsense. If the compiler is accurate, and the code does not take
liberties with the standard, the only effect of optimization is to
speed up or compress (or both) the output code. However it may
reduce the ability to debug the final program.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Nov 17 '08 #4

P: n/a
CBFalconer wrote:
"christian.bau" wrote:
Ravikiran <ravisattig...@gmail.comwrote:
....
Whenever my company outsources programming jobs they specify in
the contract how much optimisation is required. "Zero
optimisation" means code that works, without being optimised. If
we want optimisations, then someone in management has to sign
because of the additional cost, so there is always a space left
in the contract marked "Sign optimisation" where someone can sign
to require optimisation.

The differences between "sign optimisation" and "zero
optimisation" can be many thousands in cost, plus delays in
development of weeks, or even months.

Nonsense. If the compiler is accurate, and the code does not take
liberties with the standard, the only effect of optimization is to
speed up or compress (or both) the output code. However it may
reduce the ability to debug the final program.
Most real code takes some liberties with the standard, and most
compilers have some optimization options that render them slightly non-
conforming. Uncovering the "liberties" takes time and effort to fix.
Determining whether or not code modifications are required to take
advantage of non-conforming optimization options, and deciding whether
or not the optimization is worth the trouble, can take a lot of time.
Distinguishing between problems due to bad code and problems due to
dangerous optimizations also takes time.

However, I strongly suspect that Christian was not talking merely
about compiler optimization levels. I suspect he was also (perhaps
even mainly) talking about optimizations that require re-writing the
code. That requires taking the time to profile a program, determine
where it's wasting a lot of time, and then hand-optimizing those
particular sections. This will often involve a trade-off between
clarity, maintainability, cost, and efficiency. The sign-off would be
required to certify that management is willing to accept that this
trade-off is worth making. This is often denigrated as "micro-
optimization", and is (on rare occasions) absolutely necessary to meet
a performance requirement.

Nov 17 '08 #5

P: n/a
Ravikiran <ra***********@gmail.comwrites:
I wanted know about whatt is ment by zero optimization and
sign optimization and its differences....
Those aren't C language concepts, and I've never heard of them.

I just did a Google search for both terms; the only hits were for you
asking the question.

If you can tell us where you ran across these terms, we might be able
to give you an idea of a better place to ask about them, but I suspect
you've simply misunderstood something.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Nov 18 '08 #6

P: n/a
Keith Thompson <ks***@mib.orgwrites:
Ravikiran <ra***********@gmail.comwrites:
> I wanted know about whatt is ment by zero optimization and
sign optimization and its differences....

Those aren't C language concepts, and I've never heard of them.
The only pair of /\b(sign|zero) \w+ion\b/ matches I can
think of is sign extension and zero extension, such as
in the x86 opcodes movsx and movzx.

But that ain't nuthin' to do with C.

Phil
--
I tried the Vista speech recognition by running the tutorial. I was
amazed, it was awesome, recognised every word I said. Then I said the
wrong word ... and it typed the right one. It was actually just
detecting a sound and printing the expected word! -- pbhj on /.
Nov 18 '08 #7

P: n/a
On 17 Nov, 22:07, jameskuyper <jameskuy...@verizon.netwrote:
CBFalconer wrote:
"christian.bau" wrote:
Ravikiran <ravisattig...@gmail.comwrote:
...
Whenever my company outsources programming jobs they specify in
the contract how much optimisation is required. *"Zero
optimisation" means code that works, without being optimised. If
we want optimisations, then someone in management has to sign
because of the additional cost, so there is always a space left
in the contract marked "Sign optimisation" where someone can sign
to require optimisation.
The differences between "sign optimisation" and "zero
optimisation" can be many thousands in cost, plus delays in
development of weeks, or even months.
Nonsense. *If the compiler is accurate, and the code does not take
liberties with the standard, the only effect of optimization is to
speed up or compress (or both) the output code. *However it may
reduce the ability to debug the final program.

Most real code takes some liberties with the standard, and most
compilers have some optimization options that render them slightly non-
conforming. Uncovering the "liberties" takes time and effort to fix.
Determining whether or not code modifications are required to take
advantage of non-conforming optimization options, and deciding whether
or not the optimization is worth the trouble, can take a lot of time.
Distinguishing between problems due to bad code and problems due to
dangerous optimizations also takes time.

However, I strongly suspect that Christian was not talking merely
about compiler optimization levels.
I thought he was taking the micky
I suspect he was also (perhaps
even mainly) talking about optimizations that require re-writing the
code. That requires taking the time to profile a program, determine
where it's wasting a lot of time, and then hand-optimizing those
particular *sections. This will often involve a trade-off between
clarity, maintainability, cost, and efficiency. The sign-off would be
required to certify that management is willing to accept that this
trade-off is worth making. This is often denigrated as "micro-
optimization", and is (on rare occasions) absolutely necessary to meet
a performance requirement.- Hide quoted text -

- Show quoted text -
Nov 18 '08 #8

P: n/a
On Nov 17, 9:44*pm, CBFalconer <cbfalco...@yahoo.comwrote:
"christian.bau" wrote:
Ravikiran <ravisattig...@gmail.comwrote:
I wanted know about whatt is ment by zero optimization and sign
optimization and its differences....
Whenever my company outsources programming jobs they specify in
the contract how much optimisation is required. *"Zero
optimisation" means code that works, without being optimised. If
we want optimisations, then someone in management has to sign
because of the additional cost, so there is always a space left
in the contract marked "Sign optimisation" where someone can sign
to require optimisation.
The differences between "sign optimisation" and "zero
optimisation" can be many thousands in cost, plus delays in
development of weeks, or even months.

Nonsense. *If the compiler is accurate, and the code does not take
liberties with the standard, the only effect of optimization is to
speed up or compress (or both) the output code. *However it may
reduce the ability to debug the final program.
My dear CBFalconer, please explain to me what the compiler has to do
with this. I am talking about source code; I am not even mentioning a
programming language or that a compiler would be used.
Nov 18 '08 #9

P: n/a
Nick Keighley wrote:
On 17 Nov, 22:07, jameskuyper <jameskuy...@verizon.netwrote:
>CBFalconer wrote:
>>"christian.bau" wrote:
Ravikiran <ravisattig...@gmail.comwrote:
...
>>>Whenever my company outsources programming jobs they specify in
the contract how much optimisation is required. "Zero
optimisation" means code that works, without being optimised. If
we want optimisations, then someone in management has to sign
because of the additional cost, so there is always a space left
in the contract marked "Sign optimisation" where someone can sign
to require optimisation.
The differences between "sign optimisation" and "zero
optimisation" can be many thousands in cost, plus delays in
development of weeks, or even months.
....
>However, I strongly suspect that Christian was not talking merely
about compiler optimization levels.

I thought he was taking the micky
I had to look that phrase up - I've never heard it before.

I doubt it - it looked like a perfectly serious response to. I've never
heard of "sign optimization", but Christian's answer provides a
plausible explanation of why someone might run into the words "sign" and
"optimization" juxtaposed in such a way that they could misinterpret
them as referring to something called "sign optimization".
Nov 18 '08 #10

P: n/a
On 18 Nov, 11:57, James Kuyper <jameskuy...@verizon.netwrote:
Nick Keighley wrote:
On 17 Nov, 22:07, jameskuyper <jameskuy...@verizon.netwrote:
CBFalconer wrote:
"christian.bau" wrote:
Ravikiran <ravisattig...@gmail.comwrote:
>>Whenever my company outsources programming jobs they specify in
the contract how much optimisation is required. *"Zero
optimisation" means code that works, without being optimised. If
we want optimisations, then someone in management has to sign
because of the additional cost, so there is always a space left
in the contract marked "Sign optimisation" where someone can sign
to require optimisation.
The differences between "sign optimisation" and "zero
optimisation" can be many thousands in cost, plus delays in
development of weeks, or even months.
...
However, I strongly suspect that Christian was not talking merely
about compiler optimization levels.
I thought he was taking the micky

I had to look that phrase up - I've never heard it before.
I toyed with "taking the piss".
"taking the micky" is a UKism
I doubt it - it looked like a perfectly serious response to. I've never
heard of "sign optimization", but Christian's answer provides a
plausible explanation of why someone might run into the words "sign" and
"optimization" juxtaposed in such a way that they could misinterpret
them as referring to something called "sign optimization
--
Nick Keighley
Nov 18 '08 #11

P: n/a
"christian.bau" wrote:
CBFalconer <cbfalco...@yahoo.comwrote:
>"christian.bau" wrote:
>>Ravikiran <ravisattig...@gmail.comwrote:

I wanted know about whatt is ment by zero optimization and sign
optimization and its differences....

Whenever my company outsources programming jobs they specify in
the contract how much optimisation is required. "Zero
optimisation" means code that works, without being optimised. If
we want optimisations, then someone in management has to sign
because of the additional cost, so there is always a space left
in the contract marked "Sign optimisation" where someone can sign
to require optimisation.

The differences between "sign optimisation" and "zero
optimisation" can be many thousands in cost, plus delays in
development of weeks, or even months.

Nonsense. If the compiler is accurate, and the code does not take
liberties with the standard, the only effect of optimization is to
speed up or compress (or both) the output code. However it may
reduce the ability to debug the final program.

My dear CBFalconer, please explain to me what the compiler has to do
with this. I am talking about source code; I am not even mentioning a
programming language or that a compiler would be used.
Because if the compiler is inaccurate there is no guarantee that
the optimization step is accurate. Nobody in their right mind
optimizes by diddling source code.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Nov 19 '08 #12

P: n/a
CBFalconer wrote:
"christian.bau" wrote:
....
>My dear CBFalconer, please explain to me what the compiler has to do
with this. I am talking about source code; I am not even mentioning a
programming language or that a compiler would be used.

Because if the compiler is inaccurate there is no guarantee that
the optimization step is accurate. Nobody in their right mind
optimizes by diddling source code.
How do you justify that assertion? Are you seriously suggesting that
profiling a program to identify it's choke points, and looking for ways
to speed up those parts of the program, is seldom if ever cost-effective?
Nov 19 '08 #13

P: n/a
James Kuyper wrote:
CBFalconer wrote:
>"christian.bau" wrote:
...
>>My dear CBFalconer, please explain to me what the compiler has
to do with this. I am talking about source code; I am not even
mentioning a programming language or that a compiler would be
used.

Because if the compiler is inaccurate there is no guarantee that
the optimization step is accurate. Nobody in their right mind
optimizes by diddling source code.

How do you justify that assertion? Are you seriously suggesting
that profiling a program to identify it's choke points, and
looking for ways to speed up those parts of the program, is
seldom if ever cost-effective?
Alright, I was sloppy. I was thinking of the sort of optimization
a compiler does, not algorithm improvement or replacement.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Nov 19 '08 #14

P: n/a
In article <49***************@yahoo.com>,
CBFalconer <cb********@maineline.netwrote:
>James Kuyper wrote:
>CBFalconer wrote:
>>"christian.bau" wrote:
What is "no optimization"? Ok, most compilers have their own way
of not requesting optimization (except arguably for those that don't
offer any optimization to not request - I don't know of any but
there probably are some), but there's no standard for that and one
compiler's idea of "no optimization" might be quite optimized
compared with that of another compiler.

It's also unclear what "no optimization" is in source code.
Does it mean leaving in all the loops like:

for (dummy = 1; dummy != 0; dummy++) cos(0.0);
where dummy is an unsigned long long?

It's not pessimal code, though, because no matter how bad the code
is, I can always make it worse. Add branches to branches. Put
more NOP instructions between instructions. Save all the registers
and do a memory scan (creating lots of page faults if it's a
virtual-memory system) between instructions. If the code is already
doing an emulation of an emulation of native code, do an emulation
of an emulation of an emulation of an emulation.

Nov 19 '08 #15

P: n/a
Gordon Burditt wrote:
In article <49***************@yahoo.com>,
CBFalconer <cb********@maineline.netwrote:
>James Kuyper wrote:
>>CBFalconer wrote:
"christian.bau" wrote:

What is "no optimization"? Ok, most compilers have their own way
of not requesting optimization (except arguably for those that don't
offer any optimization to not request - I don't know of any but
there probably are some), but there's no standard for that and one
compiler's idea of "no optimization" might be quite optimized
compared with that of another compiler.
Has anyone used the phrase "no optimization"? If so, you should have
quoted the text where that phrase was used.

The phrase "Zero Optimization" is in the subject line of this message,
and Christian has used the phrase "code that works, without being
optimised". I think there has been some confusion about whether the
discussion is about optimization of the source code performed by the
developer, or optimization of the executable code performed by the
compiler+linker. However, I think we have all been referring to the same
basic idea: code where no special effort has been exerted to optimize
it. In the case of the source code, highly experienced programmers
write, without exerting any special effort, source code that is heavily
optimized compared to that produced by newbies. Similarly, compilers
differ greatly in how optimized their code is at the lowest optimization
level. So "Zero optimization" does not refer to a clearly defined level
of optimization, just to a clearly defined level of effort expended.
Nov 19 '08 #16

P: n/a
CBFalconer <cb********@yahoo.comwrites:
Because if the compiler is inaccurate there is no guarantee that
the optimization step is accurate. Nobody in their right mind
optimizes by diddling source code.
I practically only optimize by diddling the source code.

Phil
--
I tried the Vista speech recognition by running the tutorial. I was
amazed, it was awesome, recognised every word I said. Then I said the
wrong word ... and it typed the right one. It was actually just
detecting a sound and printing the expected word! -- pbhj on /.
Nov 19 '08 #17

P: n/a
go***********@burditt.org (Gordon Burditt) writes:
In article <49***************@yahoo.com>,
CBFalconer <cb********@maineline.netwrote:
>>James Kuyper wrote:
>>CBFalconer wrote:
"christian.bau" wrote:

What is "no optimization"? Ok, most compilers have their own way
of not requesting optimization (except arguably for those that don't
offer any optimization to not request - I don't know of any but
there probably are some), but there's no standard for that and one
compiler's idea of "no optimization" might be quite optimized
compared with that of another compiler.
[snip]

Gordon, I think this is the first time I've seen a followup from you
that actually includes attribution lines. (You didn't actually quote
anything that any of the cited posters wrote, but hey, it's a start.)

If you've changed your mind about attribution lines, I'm delighted.
Really. If it was a mistake, I suggest you sit back and watch while
Nothing Bad Happens.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Nov 19 '08 #18

P: n/a
James Kuyper <ja*********@verizon.netwrites:
Gordon Burditt wrote:
[...]
>What is "no optimization"? Ok, most compilers have their own way
of not requesting optimization (except arguably for those that don't
offer any optimization to not request - I don't know of any but
there probably are some), but there's no standard for that and one
compiler's idea of "no optimization" might be quite optimized
compared with that of another compiler.

Has anyone used the phrase "no optimization"? If so, you should have
quoted the text where that phrase was used.

The phrase "Zero Optimization" is in the subject line of this message,
and Christian has used the phrase "code that works, without being
optimised". I think there has been some confusion about whether the
discussion is about optimization of the source code performed by the
developer, or optimization of the executable code performed by the
compiler+linker. However, I think we have all been referring to the
same basic idea: code where no special effort has been exerted to
optimize it. In the case of the source code, highly experienced
programmers write, without exerting any special effort, source code
that is heavily optimized compared to that produced by
newbies. Similarly, compilers differ greatly in how optimized their
code is at the lowest optimization level. So "Zero optimization" does
not refer to a clearly defined level of optimization, just to a
clearly defined level of effort expended.
I don't think that "zero optimization" refers to anything.

The question that started this thread was:

I wanted know about whatt is ment by zero optimization and sign
optimization and its differences....

The OP was someone named Ravikiran.

My first thought was that the terms referred to some sort of
optimization of artithmetic operations having to do with special
treatment of zero values and/or of the sign bit. But as I mentioned
fairly early in the thread, a Google search for both terms got only a
few hits, all of which were the original poster asking this question.

Since the OP hasn't bothered to reply to any of the followups asking
him just what he's talking about, apparently this isn't very important
to him, and I suggest that we're wasting our time trying to come up
with a meaningful answer. Of course, sometimes meaningless questions
can lead to meaningful discussions (but, personally, I don't see that
happening in this case).

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Nov 19 '08 #19

P: n/a
Gordon Burditt wrote:
CBFalconer <cb********@maineline.netwrote:
>James Kuyper wrote:
>>CBFalconer wrote:
"christian.bau" wrote:

What is "no optimization"? Ok, most compilers have their own
way of not requesting optimization (except arguably for those
that don't offer any optimization to not request - I don't know
of any but there probably are some), but there's no standard
for that and one compiler's idea of "no optimization" might be
quite optimized compared with that of another compiler.
I suggest you replace 'trn'. It is apparantly incapable of
producing messages with proper quotations and snippages. This
makes your messages totally incomprehensible.

This is not applicable, but may be of some help. If you want to
post a followup via groups.google.com, ensure you quote enough for
the article to make sense. Google is only an interface to Usenet;
it's not Usenet itself. Don't assume your readers can, or ever
will, see any previous articles.

More details at: <http://cfaj.freeshell.org/google/>

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Nov 20 '08 #20

P: n/a
CBFalconer <cb********@yahoo.comwrites:
Gordon Burditt wrote:
>CBFalconer <cb********@maineline.netwrote:
>>James Kuyper wrote:
CBFalconer wrote:
"christian.bau" wrote:

What is "no optimization"? Ok, most compilers have their own
way of not requesting optimization (except arguably for those
that don't offer any optimization to not request - I don't know
of any but there probably are some), but there's no standard
for that and one compiler's idea of "no optimization" might be
quite optimized compared with that of another compiler.

I suggest you replace 'trn'. It is apparantly incapable of
producing messages with proper quotations and snippages. This
makes your messages totally incomprehensible.
[...]

I seriously doubt that trn is the problem. Gordon usually quotes a
reasonable amount of text, but deliberately deletes all attribution
lines. I don't know what changed this time. See my other followup in
this thread. (I'm certain my followup is on your server, since we
both use the same one.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Nov 20 '08 #21

This discussion thread is closed

Replies have been disabled for this discussion.