Science Fair Projects Ideas - Speculative execution

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

Speculative execution

In computer science, speculative execution is the execution of code whose result may not actually be needed. In the context of functional programming the term "speculative evaluation" is used instead.

Speculative execution is an optimization. It is useful only when early execution consumes less time and space than later execution would, and the savings are enough to compensate, in the long run, for the possible wasted effort of computing a value which is never used.

Modern pipelined microprocessors use speculative execution to reduce the cost of conditional branch instructions. When a conditional branch instruction is encountered, the processor guesses which way the branch is most likely to go (this is called branch prediction), and immediately starts executing instructions from that point. If the guess later proves to be incorrect, all computation past the branch point is discarded. The early execution is cheap because the pipeline stages involved would otherwise lie dormant until the next instruction was known.

Though it's seldom referred to as such, eager evaluation is also a form of speculative execution (although the situation is complicated by the presence of side effects). The early evaluation is often cheaper because values needed for the computation are likely to be available on the stack and need not be stored and later retrieved from the heap. It can also be substantially more expensive, as in the case of generating the list of integers from 1 to 1,000,000. Programmers writing code in a strict programming language avoid these cases by using explicit laziness or by circumlocution (which can become very elaborate).

Lazy evaluation does not speculate. The incorporation of speculative evaluation into implementations of the Haskell programming language is a current research topic. Eager Haskell is designed around the idea of speculative evaluation. Recent versions of GHC support a kind of speculative evaluation called optimistic evaluation .

09-23-2007 01:00:40
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice