Questions tagged [prefetch]

A technique to minimize time spent waiting for some needed data to arrive, effectively hiding the latency of the fetch or part of it. Examples include instruction and data prefetching in microprocessors, and link prefetching in html browsers.

Prefetching is a technique to minimize time spent waiting for some needed data to arrive, either externally by the user or internally by the system. If the target of the request (whether a memory address, or a web link) can be predicted well enough in advance, a prefetch dispatched early will have time to fetch the data before the actual demand, thereby hiding the latency of the demand itself when it arrives. As the prefetch may arrive even earlier than needed, prefetching is often associated with caching mechanisms. Examples include instruction and data prefetching in microprocessors (both software based and hardware prefeching), link prefetching in html browsers, and database prefetching mechanisms.

522 questions
17
votes
1 answer

Difference between PREFETCH and PREFETCHNTA instructions

The PREFETCHNTA instruction is basically used to bring the data from main memory to caches by the prefetcher, but instructions with the NT suffix are known to skip caches and avoid cache pollution. So what does PREFETCHNTA do which is different from…
Abhishek Nikam
  • 618
  • 7
  • 15
17
votes
1 answer

How to properly use prefetch instructions?

I am trying to vectorize a loop, computing dot product of a large float vectors. I am computing it in parallel, utilizing the fact that CPU has large amount of XMM registers, like this: __m128* A, B; __m128 dot0, dot1, dot2, dot3 =…
xakepp35
  • 2,878
  • 7
  • 26
  • 54
17
votes
1 answer

Use prefetch_related in django_simple_history

I have a model Booking which has a history in it. like this and I use django_simple_history class Booking(CreatedAtAbstractBase): history = HistoricalRecords() And I use a management command to do tasks. In that I wanted to Prefetch history…
Deepakraj Murugesan
  • 1,195
  • 11
  • 30
17
votes
2 answers

Can "non-native" pointers hurt cache performance?

As far as I can tell, hardware prefetchers will at the very least detect and fetch constant strides through memory. Additionally it can monitor data access patterns, whatever that really means. Which led me to wonder, do hardware prefetchers ever…
porgarmingduod
  • 7,668
  • 10
  • 50
  • 83
16
votes
1 answer

Can an AJAX request utilize link prefetching?

As most of you know, HTML5 introduced a standardized browser mechanism called link prefetching, one that allows preloading the content of select URLs in the background, if the browser determines there is no network activity. It's used by adding the…
John Weisz
  • 30,137
  • 13
  • 89
  • 132
16
votes
1 answer

How do I gain measurable benefit from prefetch intrinsics?

Using gcc 4.4.5 (yeah... I know it's old) on x86_64. Limited to SSE2 (or earlier) instructions for compatibility reasons. I have what I think should be a textbook case for gaining big benefits from prefetching. I have an array ("A") of 32-bit…
Marty
  • 435
  • 5
  • 16
16
votes
2 answers

Prefetching data to cache for x86-64

In my application, at one point I need to perform calculations on a large contiguous block of memory data (100s of MBs). What I was thinking was to keep prefetching the part of the block my program will touch in future, so that when I perform…
pythonic
  • 20,589
  • 43
  • 136
  • 219
15
votes
2 answers

How to disable Pre-loading of pages or Prefetch in Google Chrome?

I'm debugging a web application running in visual studio with some breakpoints on some code that runs on every request to my web application. I find that in Chrome, as I type the URL past the host, it triggers a request for everything I type as I…
Ryan Mann
  • 5,178
  • 32
  • 42
14
votes
3 answers

On webpack how can I import a script without evaluate it?

I'm recently working on some website optimization works, and I start using code splitting in webpack by using import statement like this: import(/* webpackChunkName: 'pageB-chunk' */ './pageB') Which correctly create the pageB-chunk.js, now let's…
小广东
  • 1,151
  • 12
  • 20
14
votes
0 answers

Google Lighthouse Not Recognizing preconnect and dns-prefetch

The performance report in Google Lighthouse made the following recommendation: Avoid multiple, costly round trips to any origin "Avoid multiple, costly round trips to any origin"...It then proceeds to list 8 origins. So, I added the following code…
Devin Peterson
  • 241
  • 1
  • 7
14
votes
4 answers

typeahead, bloodhound : remote works but not prefetch

I want to use prefetch and I can't have it working ! Here is my code : function initAutocompletion() { $("input[data-autocomplete-prefetch-url]").each(function () { var $this = $(this); var urlPrefetch =…
boblemar
  • 1,143
  • 1
  • 10
  • 24
13
votes
1 answer

Cost of a sub-optimal cacheline prefetch

What is the cost of a late prefetch done with a __builtin_prefetch(..., 1) intrinsic (prefetch in preparation for a write)? That is, a prefetch that does not arrive in the L1 cache before the demand load or write that requires it? For example void…
Curious
  • 20,870
  • 8
  • 61
  • 146
12
votes
2 answers

Django chaining prefetch_related and select_related

Let's say I have following models class Foo(models.Model): ... class Prop(models.Model): ... class Bar(models.Model): foo: models.ForeignKey(Foo, related_name='bars', ...) prop: models.ForeignKey(Prop, ...) Now I want to make the…
Pavan Kumar
  • 1,715
  • 1
  • 24
  • 48
12
votes
2 answers

In which condition DCU prefetcher start prefetching?

I am reading about different prefetcher available in Intel Core i7 system. I have performed experiments to understand when these prefetchers are invoked. These are my findings L1 IP prefetchers starts prefetching after 3 cache misses. It…
bholanath
  • 1,699
  • 1
  • 22
  • 40
12
votes
2 answers

How to prefetch video in a react application?

I have a React app with a component that loads different videos depending on user input. There are only 4 or 5 small videos, so I'd like to pre-fetch all of them when the browser is inactive. Within my component, I have:
bluprince13
  • 4,607
  • 12
  • 44
  • 91
1
2
3
34 35