539 questions
0
votes
0
answers
49
views
TRPC prefetching fails on protected procedure
I was working on a nextjs monorepo using trpc as backend I am integrating SSE with normal trpc methods, I implemented auth using better auth and it works very smoothly, but when I try to prefetch on ...
1
vote
0
answers
49
views
gem5 Cache Prefetcher Assertion Failure in sendMSHRQueuePacket: Prefetch Request Sent for an Existing Cache Line
I'm currently using gem5-dpdk (GitHub) with the following cache hierarchy setup:
Using ARM version(O3 cpu), full system mode
Simulating DPDK network application (e.g., MACSWAP)
L1 Cache: no ...
1
vote
0
answers
69
views
disabling HW-prefetcher on an android Pixel 8
I am writing a kernel module which makes some low level experiments, and I've noticed that the HW prefetcher is intrupting them. I want to disable it while the experiemnts run.
I am running on Pixel 8 ...
4
votes
1
answer
205
views
Why is my benchmark using __mm_prefetch slower?
I am trying to learn some C++ optimizations and I have tried using __mm_prefetch for summing an array. The benchmark tests for my code is:
#include <benchmark/benchmark.h>
#include <vector>...
1
vote
1
answer
167
views
What are these prefetch refs and how do I get rid of them?
I have been using gitk for years. Today I noticed that there are a bunch of new refs in my repo. See screenshot below.
The ref is prefetch/remotes/origin/<branch>, and there is one like this ...
6
votes
1
answer
268
views
Can I read a CPU x86 flag to determine if prefetched data has arrived in the L1 cache?
I want to prefetch data into the L1 cache and perform other work while waiting for the data to arrive, to avoid stalling the loop. Is there a way to determine if the prefetched data has arrived in the ...
0
votes
1
answer
44
views
Can cloud email services or desktop email clients visit a verification link prematurely?
Say I send an email that contains a link with a verification token, as it often happens for email subscription confirmation emails.
Is it possible that the cloud email service or a desktop agent would ...
2
votes
0
answers
134
views
How many cache lines does the adjacent cache line prefetcher bring into cache?
I was investigating the effectiveness of the adjacent cache line prefetcher and its impact on the number of cache lines prefetched from DRAM. Initially, I assumed it fetched only one more adjacent ...
0
votes
0
answers
83
views
Celery + RabbitMQ: Is there a way to disable prefetching while avoiding requeue on a lost worker
I want to disable prefetching on my celery workers (using RabbitMQ + Redis).
As seen here Understanding celery task prefetching in order to disable prefetching, I need to set:
...
1
vote
1
answer
115
views
Does x86 prefetch outside of code segment?
The x86 architecture has started using prefetching right with its original ancestor, the 8086. To my knowledge all modern microarchitectures are doing some kind of prefetching, e.g. via the ...
1
vote
1
answer
48
views
Pre-fetching huge querysets in django
TLDR: how can I prevent very large IN sets in the SQL query generated?
When I pre-fetch a ManyToMany field pointing to model Tag from a model Object:
obj_qs = models.Object.objects.filter(...
1
vote
1
answer
21
views
Set constant from URL on prefetched site
I have a multi page application, where a page has to pass a variable (road) to a dynamic page. I just grabbed the value from the URL, but as I changed the page to prefetch, it broke, since the URL is ...
0
votes
0
answers
135
views
next/link does not prefetch when embedded in vite compiled package
I have a NextJS app that incorporates shared components from another repo which is built into a package via vite.
next/link instances inside the package do not prefetch when run inside the next app. ...
1
vote
0
answers
73
views
How prefetching instructions achieve latency hiding?
Here is an example of manually adding prefetch instructions(to CPU cache) to accelerate binary search:
using prefetch to accelerate binary search
By prefetching the location for the next binary search,...
0
votes
1
answer
59
views
Prefetching complex query that does a Union
I'm trying to prefetch a related object to optimize performance. The code I'm trying to Prefetch is this;
class Product(models.Model):
...
def get_attribute_values(self):
# ToDo: ...
4
votes
0
answers
107
views
How to write a performance-portable daxpy?
Problem
A daxpy is the computation y = y + alpha * x for vectors x, y and scalar alpha. This is limited by RAM-CPU bandwidth if x, y do not fit in cache. On my system, I consistently get only 23 GB/s, ...
2
votes
3
answers
817
views
Next.js 14 Link Tag Doesn't Prefetch Data - Network Tab Shows Empty {}
I'm currently working with Next.js 14 and encountered an issue where the Link tag does not seem to prefetch data. Specifically, in the network tab of the developer tools, the preview shows {} instead ...
1
vote
0
answers
144
views
optimize indexing while inside of a loop
i want to try optimizing this line of code:
for i in 0..len {
slots[values[i].slot].count += 1;
}
(both of these lists are extremely long and the same size)
i have already optimized it like this(...
2
votes
0
answers
77
views
the Perf event issues of hardware prefetcher (all_pf_data_rd and pf_l2_data_rd)
My platform is 2nd generation scalable Xeon, equipped with a non-inclusive cache. I run a series of tests that had the L2 stream prefetcher aggressively prefetching.
I use Perf to monitor performance, ...
0
votes
1
answer
76
views
How to prefetch external JSON and use it?
I want to prefetch (or maybe preload) a JSON file from an URL and use it later on my JS file. How can I send the prefetched JSON to the JS file?
Something like on the HTML head:
<link rel="...
4
votes
0
answers
359
views
How does the next PAGE hardware prefetcher work?
L2/L3 hardware prefetcher behaviors are well documented (their aggressiveness, their tiggers, etc). However, very little is known about the next-page prefetcher that supposedly pre-loads the TLB when ...
0
votes
0
answers
147
views
Optimizing Memory-Bound Loop with Indirect Prefetching
I'm currently working on optimizing a kernel, and one of the most time-consuming loops, despite optimization efforts, still accounts for 80% of the benchmark's execution time. The loop's performance ...
1
vote
1
answer
47
views
how to prefetch comments in django [duplicate]
class Comment(models.Model):
parent_comment=models.ForeignKey(
to='self',
related_name='_comments',
on_delete=models.DO_NOTHING,
null=True,
blank=True,
how to prefetch _comments: ...
1
vote
0
answers
84
views
why is there a need to stop prefetching to pages when a write happens to it?
I read in this StackOverflow answer that prefetching does not happen for dirty pages.
In which condition DCU prefetcher start prefetching?
It seems to me that the prefetcher is receiving the dirty ...
0
votes
0
answers
64
views
Change html page seamlessly on buttonPress
I am trying to find a way to change my html page on button press seamlessly (imagine pageA.html ends with a fullscreen image -> pageB.html starts with the same fullscreen image).
I have tried manually ...
0
votes
1
answer
313
views
Django's Very slow initial execution of select query on remote Oracle 11 database when table contain big blobs
I actually understand what is causing the problem but can't figure out a solution that works with Django.
suppose you are trying to read 10,000 records from oracle database over network, normally ...
0
votes
0
answers
347
views
How can I determine if my Intel CPU supports disabling prefetching through model specific registers?
I will be helping with a hardware security class in the spring, and I am currently setting up some of the labs for the class. One of the labs we are doing is a cache side-channels lab where we look at ...
-1
votes
1
answer
181
views
Reading prefetch file content
I'm using python prefetch view to read the prefetch files' content.
But the tool show something like volume guid or anything instead of volume letter
Is there any correct way to convert "\VOLUME{...
3
votes
1
answer
347
views
Which execution unit in the CPU executes the prefetch instruction?
According to Intel's manual, prefetch instructions generally do not trigger faults or exceptions, which is different from regular load instructions.
PREFETCH provides a hint to the hardware; it does ...
-2
votes
1
answer
159
views
How can I further optimize this code regarding array operations?
In the following code I am performing an XOR operation on two arrays result and DB, the result is accessed after an offset called rotate1 in the following. As you can see, I am already doing AVX2, ...
1
vote
1
answer
182
views
GCC, GDC, and LLVM and LDC compilers’ prefetch builtins - exact meaning of the locality parameter
In the description of the x86 prefetch instructions, I found the following explanation for the instructions’ hint number
"Fetches the line of data from memory that contains the byte specified ...
1
vote
1
answer
205
views
Not getting any cache-pollution benefit from PREFETCHNTA on Zen 3
I'm trying to write a non-cache-polluting memcpy (using PREFETCHNTA for reads and streaming writes) and first doing some artificial benchmarking to determine what prefetch distances work well. I've ...
0
votes
0
answers
173
views
Is there a way I can improve performance by using special prefetch instructions and if so where/how to deploy them?
I have written a recursive descent parser, so one that is not table-driven, and it typically only takes a very small amount of input text which might only be 30-100 code units (optionally either 16-...
1
vote
0
answers
71
views
How to calculate F1 score for tensor flow dataset which is batched and prefetched (multi label image classification)
This is the code snippet for the datasets
train_ds= tf.keras.preprocessing.image_dataset_from_directory( "./tmp/Alzheimer_s_Dataset/train/", validation_split=0.2, subset="training",...
0
votes
1
answer
708
views
Having trouble prefetching data in Next.js
I have a simple dummy API that returns an array of objects dummy data such as:
// api/projectsdata.js
export default function handler(req, res) {
res.status(200).json([{...},{...},{...}]
...
0
votes
1
answer
432
views
ActiveMQ prefetchPolicy of 1 causes messages to timeout, while 0 appears to work. Misunderstanding of concept?
We have queues where some message may take milliseconds to process and some minutes (i.e. both fast and slow messages). A problem we have been seeing is that messages get dropped due to timeout (no ...
0
votes
1
answer
715
views
What are the implications of designing prefetchers at different cache levels?
I see a lot of papers about prefetching, some of them claim to be used at L1 level, and some claim to be used at LLC level.
Why is there such a restriction?
I know that the L1 data cache is much ...
1
vote
1
answer
836
views
How instructions are fetched into modern CPUs(2023)?
I am learning rocketchip these days, and I have noticed the IFU(Instruction Fetch Unit) fetches instructions from ibuf instead of main memory. But I have not seen any codes about how instructions are ...
0
votes
1
answer
33
views
Django REST framework prefetch not working on model with multiple foreign keys to the same target
I'm writing an endpoint to fetch data from the "Term" model in Django REST framework and I'm trying to reduce queries by prefetching data. Specifically there is a model "TermRelation&...
1
vote
2
answers
3k
views
Has anyone ever done this before? Caching Images and showing them offline the first time they appear?
I created an app with react native (expo) that shows a lot of product images. My customer wants the app to work 100% offline. This means that the images should all be prefetched when the app is ...
2
votes
0
answers
73
views
_mm_prefetch and heap buffer overflow
I saw a piece of code that looked like this sample program:
#include <immintrin.h>
int main() {
int arr[1024];
for (int i = 0; i < 1024; i++) {
arr[i] = i;
}
// Declare a ...
2
votes
0
answers
789
views
Module federation prefetch during browser idle time
Requirement: To prefetch the remote modules(module federated) during browser idle time in react.
I've tried webpack magic comment webpackPrefetch: true but that did not work with module federation. I ...
1
vote
1
answer
219
views
Using tf.data.Dataset prefetch makes model performance overfit?
I'm trying to train a simple LRCN model with some sequential image dataset in Tensorflow 2.5.0.
Training performance was fine like increasing to 0.9x training & validation accuracy both in first 5 ...
1
vote
0
answers
297
views
prefetch data with header and body next.js
I have question about prefetching data.
As i know, normally we can not prefetch data with header and body in getstaticprops nextjs 12 or new fetch way in nextjs 13 because it rendered on the server ...
0
votes
1
answer
120
views
Does the last level cache see the PC?
I was recently reading some papers on caching data prefetching. I found that the cache prefetch technology implemented in LLC needs to record the PC of the memory access instruction. But does the LLC ...
3
votes
0
answers
760
views
NextJs rewrites does not proxy API calls in getServerSideProps
I am using react-query prefetchQuery and NextJS (v.13) getServerSideProps along with its rewrites option in next.config.js file to proxy API calls.
The rewrites looks like this:
async rewrites() {
...
0
votes
1
answer
68
views
In Django, how to filter a _set inside a for loop?
I have these two models:
class Convocacao(models.Model):
cursos = models.ForeignKey(Cursos)
class RegistroConvocacao(models.Model):
convocacao = models.ForeignKey(Convocacao)
I get a specific ...
1
vote
1
answer
463
views
Is __builtin_prefetch safe to be call with nullptr
Suppose we have linked list and code like this:
void play_with_list(struct int_list *list) {
while (list != NULL) {
__builtin_prefetch(list->next);
do_something(list->n);
list = list->...
1
vote
0
answers
239
views
How to interpret the effect of stride size on Intel's hardware prefetching?
In Section 9.5.3 of Intel® 64 and IA-32 Architectures Optimization Reference Manual, the effects of hardware prefetching are described as follows:
The effective latency reduction for several ...
1
vote
0
answers
726
views
Vue.js 2 / Webpack Part disable Prefetch - Cannot call .tap() on a plugin that has not yet been defined. Call plugin('prefetch').use(<Plugin>) first
I have a piece of config in my vue.config.js file which is intended to prevent Vue from prefetching files that are dynamically loaded.
The code looks like this...
chainWebpack: config => {
...