539 questions
10
votes
0
answers
699
views
How do I query Wagtail tags without it creating hundreds of queries, n+1 problem?
I have a handful of entries that each has dozens of "tags" when I try to fetch that data it causes hundreds of queries. While using prefetching works on all of my other models and links, it does not ...
2
votes
1
answer
3k
views
Lazy Route gets prefetched, ignoring webpack magic comments (Vue)
I need to develop an application with server side authentication with a login view. If I want to use Vue Router to dynamically switch between login and index (the protected view), I need to avoid ...
2
votes
1
answer
13k
views
Django: Prefetch_related on nested attributes
I need to list all my devices. To do this I use a prefetch related to reduce the amount of queries. But one of them is consuming to much time.. I wonder if it can't go better.
I will start with the ...
1
vote
0
answers
214
views
IE11 and Edge 18: why doesn't onload fire when combined with rel=prefetch?
Both IE11 and Edge 18 support prefetch, but don't fire the onload event when the prefetched file is loaded.
If you load this example in IE11 or Edge 18, the file is loaded, but since the onload ...
2
votes
0
answers
1k
views
Django prefetch_related() in ListView class based view
I have a simple blog with 2 models: one for Post and one for Comment, like so:
class Post(models.Model):
title = models.CharField(max_length=100)
# content = models.TextField()
content = ...
0
votes
1
answer
1k
views
Preload fonts to speed up website, don't download them twice?
I want to preload the both fonts I am using from this file here: https://res.cloudinary.com/prodigy-official-de/raw/upload/v1581064331/www.prodigy-official.de%20resources/fonts/font.style.css
So what ...
0
votes
1
answer
183
views
postMessage from navigator in componentDidMount returns undefined
Im trying to implement some prefetching via a service worker that would be triggered when a React component mounts and has the data necessary for the worker to reach out to the API and return/cache ...
0
votes
1
answer
161
views
How to group all the related data and return as a values dict in django?
I have 3 models:
class City(models.Model):
name = models.CharField(max_length=150)
class Person(models.Model):
name = models.CharField(max_length=150)
city = models.ForeignKey(
...
2
votes
0
answers
369
views
Access store vuex in quasar for meta
I'm using quasar in SSR mode and I would like to implement meta data. Quasar has a plugin for meta data and I wanted to use it.
For now my project is quite simple, I have a page product (/product/:...
1
vote
0
answers
87
views
best practice to picasso fetch with match parent in android
I'm using Picasso to download pictures and show them in a RecyclerView. I'm trying to prevent the small delay which is happening when I'm scrolling the RecyclerView and Picasso is downloading the new ...
14
votes
3
answers
5k
views
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')
...
2
votes
1
answer
277
views
Are there cross-platform ways to promote prefetching for reading a large Boost memory mapped_file?
I have a C++ application for Windows and Linux (e.g. Boost 1.53.2 on Amazon Linux) that is using Boost::iostream::mapped_file (i.e. a memory mapped file). The documentation doesn't mention "prefetch"....
4
votes
2
answers
3k
views
How to always prefetch_related for a specific django model
One of my models has number of related objects in it's __str__. This makes the admin site run very slow.
Is it possible to set up the model in a way that would always do prefetch_related, even if not ...
2
votes
1
answer
1k
views
How to aggregate with prefetch related and prefetch
I Have two models clinic and ClinicCredits:
I want a list of clinics withsum of available balance
The Problem is if i use annotate i have to loop for avalibale alance with queryset of cliniccredits :
...
3
votes
2
answers
4k
views
How to use prefetch_related across mutliple one-to-many relations in Django?
My goal is to use prefetch_related to obtain all my models and related models in one Django query, thus not hitting the database when iterating through related models.
Say I have the following models ...
0
votes
0
answers
145
views
Django: Is it wise to prefetch when you only need a fraction of the queryset?
I have the following statement which prefetches the cousin objects related to each user and then slices the queryset to get the last 10 elements:
subquery = (
Message.objects.values("...
1
vote
3
answers
2k
views
Queries are too slow; prefetch_related not solving the problem
We are using Django 2.1 for Speedy Net. I have pages which display about 96 users per page, and for each user I want to display how many friends he has on Speedy Match, with an active email address. ...
0
votes
0
answers
177
views
No option to disable prefetching in BIOS
I have been trying to disable prefetching in my laptop. After many attempts, I realized intel stopped disclosing information on how to disable prefetching from nehalem architecture.
Even if I try to ...
1
vote
2
answers
2k
views
Using preconnect resource hint from the main window to improve the performance of a script inside a foreign iframe
I have a website that have a foreign iframe. There are multiple third party scripts that run inside this foreign iframe.
I know that if I will prefetch these scripts from the main window - the iframe ...
9
votes
1
answer
11k
views
What do the TensorFlow Dataset's functions cache() and prefetch() do?
I am following TensorFlow's Image Segmentation tutorial. In there there are the following lines:
train_dataset = train.cache().shuffle(BUFFER_SIZE).batch(BATCH_SIZE).repeat()
train_dataset = ...
0
votes
1
answer
563
views
Force Gatsby to prefetch linked page
In my app, I'm storing state in a global object (similar to, but not Redux). When users navigate around the site, I want this state to persist. Gatsby intelligently tries to prefetch page content for ...
2
votes
3
answers
2k
views
Prefetch images shown by a CachedNetworkImage
Flutter's CachedNetworkImage is nearly magic, but it would be better if they offered a way to download the images before having to show them. I want to download images in one screen and show them in ...
0
votes
1
answer
372
views
How to fix "UnicodeDecodeError: 'utf-8'" when loading traces files
I tried to implement a basic trace modeler, and the first thing is to load traces (.xz files), which are available at http://hpca23.cse.tamu.edu/champsim-traces/speccpu/
import csv
with open('400....
1
vote
1
answer
3k
views
Django/DRF - prefetch_related() returning all objects without properly matching the foreign key relationship?
So hey guys I've been running into a problem with my endpoints. I've been trying to use return Player.objects.prefetch_related('playerstatistic_set') to return me the Player objects that match with ...
1
vote
0
answers
583
views
Why is the software prefetch (_mm_prefetch ) I use is invalid in C?
I wrote a program that tests _mm_prefetch(with gcc -O3): there are two random arrays,
one of which traverses 1/600 of the length of the first random array (hardware prefetch, cache hit)
another ...
1
vote
1
answer
402
views
How can I prefetch_related() everything related to an object?
I'm trying to export all data connected to an User instance to CSV file. In order to do so, I need to get it from the DB first. Using something like
data = SomeModel.objects.filter(owner=user)
on ...
-1
votes
1
answer
114
views
how to refetch data that has already been fetched
My tableView uses prefetching to cache images and works perfectly when I start the app but once I close out of the app, sending it to the background (not fully shutting it down) and click the app ...
0
votes
1
answer
399
views
With Python3 & Stomp, how to disable prefetch of activemq?
I'm designing a distributed project, on win10. However all messages goes to one consumer with below code. It caches all before handling them. What is the correct way to to that?
# -*-coding:utf-8-*-
...
0
votes
0
answers
192
views
How to use Django ORM for multiple inner joins on nested foreign keys
I would like to do multiple joins on some django models with a filter on one of the joined tables.
Here is what the raw SQL would look like:
SELECT DISTINCT c.id, c.description FROM public....
3
votes
0
answers
143
views
DNS-prefetch and preconnect: Only for non-cached resources?
This is a question about dns-prefetch and preconnect, and possible optimizations:
If a resource is cached, are dns-prefetch and preconnect still doing their job?
If not, is it possible to optimize ...
0
votes
1
answer
3k
views
Get related objects in Django and how to use Prefetch with related models
models.py
class Press(models.Model):
created = models.DateTimeField(editable=False)
title = models.CharField(max_length=500, blank=True)
slug = models.SlugField(max_length=600, blank=True,...
2
votes
1
answer
336
views
RabbitMQ - Will the same message be delivered to consumers on separate connections
If I have and exchange with a single queue bound to it. I have two processes each with their own connection. Each connection has its own consumer which is consuming messages from that single queue.
...
2
votes
0
answers
682
views
How to use AfterJS getInitialProps in React functional components
I can't get After.js (with Razzle) getInitialProps to work in functional components. Since I only use these kind of components (using hooks) I would need getInitialProps working with these components ...
2
votes
1
answer
843
views
How to prefetch external HTML pages in safari?
I am currently using nextJS (with react) and its working great. I am also using data prefetch link to prefetch links within the application and it works awesome.
I have a requirement to prefetch ...
5
votes
3
answers
2k
views
Prevent pre-fetching of links in emails
I am sending HTML-formatted event invitation emails to customers with accept/decline links in them. It seems that some of these links are being pre-fetched though, resulting in the invitations being ...
0
votes
0
answers
615
views
How to prefetch cells in a TableViewController?
I read about Prefetching and added the delegate, the datasource and the two functions required, now, what do I need to put in those two? Is this what's used to achieve 60 fps smooth scrolling?
Sorry ...
5
votes
0
answers
817
views
webpack prefetch with react Router
I want to add a prefetch for a component in React Router, but currently the component is a Dynamic Import. Adding webpackprefetch= true does not work. Hence want to know what would be the best way to ...
0
votes
1
answer
361
views
Is there a way to load only a few items from a large list of objects and populate into a UICollectionView
I have a List containing 100 objects, but i want to load only the first 10 and populate it into my UICollectionView and when i scroll down i can then populate the remaining objects into the list.
...
7
votes
2
answers
612
views
Why does using MFENCE with store instruction block prefetching in L1 cache?
I have an object of 64 byte in size:
typedef struct _object{
int value;
char pad[60];
} object;
in main I am initializing array of object:
volatile object * array;
int arr_size = 1000000;
array =...
0
votes
2
answers
1k
views
How can I verify that my hardware prefetcher is disabled
I have disabled hardware prefetching using the following guidelines:
Installed msr-tools 1.3
wrmsr -a 0x1A4 1
The prefetcher information for my system (Broadwell) is in the msr address 0x1A4
as ...
10
votes
1
answer
1k
views
how to prefetch parents of a child on mptt tree with django prefetch_related?
Say, I've got a product instance. Product instance linked to 4th level child category. If I only want to get root category and 4th level child category the query below is enough to fetch data with ...
0
votes
0
answers
357
views
How to avoid CHROME prefetch request at OAUTH flow?
I talk about .NET & IIS.
When type protected resource URL - it starts all OAUTH proccess (getting auth code, and even getting access tokens).
It seems to me - CHROME caches prefetch results, ...
6
votes
1
answer
2k
views
Preload and CSP in Chrome
I have a site which has some <link rel="preload" href="... tags on a web page, where I also want to add as strict as possible CSP headers and as part of that I want to use default-src 'none'
...
1
vote
1
answer
534
views
Following nested foreign keys while prefetching in Django
I have an information model with deep and complex foreign key relations. and lots of them. Because of it I am trying to use select_related() and prefetch_related() to minimize the number of queries to ...
1
vote
1
answer
863
views
How can I prefetch images with AlamofireImage using the uiprefetching delegate?
I'm trying to implement the UITableViewDataSourcePrefetching delegate for my tableView using AlamofireImage. But how can I set up this?
I already added the delegate and in my viewDidLoad I've set: ...
14
votes
1
answer
707
views
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 ...
2
votes
0
answers
60
views
Prefetch a cacheline in exclusive mode [duplicate]
I searched around for this, but was unable to find a conclusive answer. What parameters do I need to pass to __builtin_prefetch to fetch a cacheline in exclusive mode (i.e. after prefetching, the ...
3
votes
1
answer
495
views
Is there a way to prefetch LOBs data in occi?
I'm working on a C++ application with Oracle as database and trying to fetch thousands of records with CLOB datatype.
Been searching the net on how to prefetch a CLOB datatype in OCCI but always see ...
4
votes
1
answer
3k
views
Correctly disable Hardware Prefetching with MSR in Skylake
I am trying to disable hardware prefetching on my machine:
CPU family: 6
Model: 78
Model name: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
I have checked with: gcc -march=...
1
vote
1
answer
560
views
Prefetch parsing - unknown volume disk
I use the library to parse the prefetch files.
https://github.com/EricZimmerman/Prefetch
There was a problem with the output path to the file. For some reason, gives an unknown disk. The screenshot ...