Nullstone Logo

COMPANY
Home
Contacts
Customers
Testimonials

PRODUCTS
Overview
NULLSTONE for C
NULLSTONE for Java
Technical Overview

SUPPORT
Release Notes
Download
PGP Information
Service Report
Write Us

INFORMATION
Performance Results
Glossary of Terms

RELATED LINKS
Compiler Connection
Compiler Jobs

Previous Up Next
Loop Unrolling

Loop overhead can be reduced by reducing the number of iterations and replicating the body of the loop.

Example:

In the code fragment below, the body of the loop can be replicated once and the number of iterations can be reduced from 100 to 50.

    for (i = 0; i < 100; i++)
      g ();
    

Below is the code fragment after loop unrolling.

    for (i = 0; i < 100; i += 2)
    {
      g ();
      g ();
    }
    

© 1990-2012 Nullstone Corporation. All Rights Reserved.