Git Product home page Git Product logo

memlatency's Introduction

Memlatency

  1. Cache Line Size was determined by timing the access times while increasing the stride of accessing an array. As soon as the stride gets past the Cacheline size, there is a bump in the access time. This size is captured and results are produced.

Here, the biggest hurdle was to prevent prefetching. To do so, I multiplied the stride by an additive and then computed the bit wise AND with the max length (To prevent segfault).

This way each access was a new one, and hence once the stride moved past the cacheline size, each new access increasingly became a cache-miss and hence we know our cacheline size. Stride jumped by two times each time. This is because continuous access lets the prefetchers prefetch all the contents; hence no bump in time.

Before doing all of this, just after allocating memory for the array access, I touched each page once to remove all minor-page faults. This removes noise from our calculations.

  1. Cache Size My computer has three caches: L1, L2, L3. I have used the same technique as the Cacheline size test. Here, we access a new cache line in each access. Each access is a new one, hence old cache entries can not be used. At some point, the access will not be able to fit in the cache, this is when my access will be catered by a slower cache; capture these bumps. These are your cache sizes. I have defined one function which is designed to give all the cache sizes. It takes in approximate start size and end size for the cache and gives out the size of cache based on access time bumps.

  2. Memory Latency To prevent any cache involvement for accesses, I have defined a linked list. Each node in this linked list is worth a page size(4098K). This makes the prefetches useless because they prefetch at a page-level. An average of the total time of numerous accesses is taken and returned.

memlatency's People

Contributors

shaleengarg avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.