maximse the use of cache in code

Discussion in 'C Programming' started by zaheer031@gmail.com, Jan 3, 2008.

  1. Guest

    Hi All,

    How do I maximse the use of cache( both data and instruction ) in the
    code .

    I know use of loops and local variables will help but more would be of
    good help


    Thanks,
    Zaheer.
    , Jan 3, 2008
    #1
    1. Advertising

  2. In article <>,
    <> wrote:

    >How do I maximse the use of cache( both data and instruction ) in the
    >code .


    comp.arch might be a better newsgroup for you, if you want
    information on how various systems work with their caches (i.e.,
    with a goal of writing cache-friendly code suitable for multiple
    systems.) If you do not care about how cache-friendly your code is
    on general systems as long as it maximizes the cache use on a
    particular platform, then consult a newsgroup specific for that platform.

    The C programming language says little or nothing about caches, and
    does itself not provide any of the tools you would need to measure
    or improve cache performance. Caching is a matter not within the
    pervue of C itself, so this is not an appropriate newsgroup for
    advice on cache use.


    >I know use of loops and local variables will help but more would be of
    >good help


    Even that is wrong on some platforms. On some platforms, there is
    a small section of memory at the beginning of the address space that
    can be addressed with shorter faster instructions (fewer address
    bits to work with.) On such systems, the best cache performance
    might involve use of that small section of memory rather than involve
    use of local variables: when instructions are shorter, more of them
    fit into instruction cache. Thus, to maximize your cache use, you
    need to use platform-specific information.
    --
    "Is there any thing whereof it may be said, See, this is new? It hath
    been already of old time, which was before us." -- Ecclesiastes
    Walter Roberson, Jan 3, 2008
    #2
    1. Advertising

  3. <> wrote in message
    news:...
    > Hi All,
    >
    > How do I maximse the use of cache( both data and instruction ) in the
    > code .
    >
    > I know use of loops and local variables will help but more would be of
    > good help
    >

    ask in comp.arch
    Ravishankar S, Jan 3, 2008
    #3
  4. user923005 Guest

    Re: maximse the use of cache in code

    On Jan 2, 10:12 pm, "" <> wrote:
    > Hi All,
    >
    > How do I maximse the use of cache( both data and instruction ) in the
    > code .
    >
    > I know use of loops and local variables will help but more would be of
    > good help


    http://www.google.com/search?hl=en&q=cache friendly algorithms
    user923005, Jan 3, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Nokes

    Cache::Cache Stale Segments

    Jeff Nokes, Sep 30, 2003, in forum: Perl
    Replies:
    0
    Views:
    549
    Jeff Nokes
    Sep 30, 2003
  2. DesignerX

    Page.Cache vs HttpContext.Current.Cache

    DesignerX, Jan 20, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    8,212
    vMike
    Jan 20, 2004
  3. =?Utf-8?B?b25l?=
    Replies:
    1
    Views:
    5,257
    Karl Seguin [MVP]
    Mar 8, 2006
  4. Sergey via DotNetMonster.com

    ASP.NET Cache vs Window System Cache

    Sergey via DotNetMonster.com, Nov 15, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    459
    Sergey via DotNetMonster.com
    Nov 15, 2006
  5. John
    Replies:
    2
    Views:
    1,165
Loading...

Share This Page