473,378 Members | 1,394 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Zero Optimization and Sign Optimization???

Hi Friends,

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


Nov 17 '08 #1
20 2303
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
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
"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
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
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
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
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
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
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
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
"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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: matthias_k | last post by:
Hi, I am currently implementing a solver for linear optimization problems using the revised simplex method and I stumbled accross some strange behavior regarding the treatment of the number 0....
1
by: florian.boldt | last post by:
Hi Folks, one of our developers uses a statement with a where clause which usually does not match to any rows. In case of one or more rows found she wrote a an expression in the select clause...
4
by: Christopher Benson-Manica | last post by:
How does one determine whether a double is equal to -0.0000...? Will fabs() from math.h return 0.000... on -0.0000...? -- Christopher Benson-Manica | I *should* know what I'm talking about -...
8
by: Avin Patel | last post by:
Hi, Does the Double has the facilty to define -0. If it has, "==" or System.Math.Sign() doesn't able to differentiate between -0 & 0. i.e. Double x = -0.0d Double y = 0.0d if(value ==...
23
by: Hallvard B Furuseth | last post by:
As far as I can tell, (x & -1) is nonzero if the integer x is negative zero. So for signed types, x == 0 does not guarantee (x & foo) == 0. Is that right? (Not that I expect to ever encounter a...
8
by: cppquester | last post by:
I am forced to work with a char* buf; I allocate memory and then construct some data types in buf (several different at different locations of buf kind of struct alike) Sometimes all data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.