102,766 questions
Advice
0
votes
0
replies
25
views
Why is FileReader as efficient as BufferedReader in reading 1KB chunks of data?
I was trying to read data (chars) from a large text file (~250MB) in 1KB chunks and was very surprised that reading that file using either FileReader or BufferedReader takes exactly the same time, ...
0
votes
1
answer
55
views
MRU structure with fixed number of elements, automatically adapting to LINQ queries
I have a folder containing huge numbers of files in many subfolders, and I want to select the files with a name that matches any of a specified list of patterns (regular expressions). My regular ...
Advice
0
votes
13
replies
212
views
JDK 21 What is the point of wrapping a FileReader/InputStreamReader in a BufferedReader?
Java Tutorials site shows this example when discussing character streams:
//The CopyLines example invokes BufferedReader.readLine and PrintWriter.println to do input and output one line at a time.
...
Advice
0
votes
4
replies
149
views
Why is my O(nlogn) solution faster than the O(n) solution
here is my solution to the leetcode "longest consecutive sequence" problem:
class Solution:
def longestConsecutive(self, nums: List[int]) -> int:
if len(nums) == 0:
...
-4
votes
0
answers
68
views
Why is only my MySQL client on Windows 11 slow? [closed]
I have a brand new computer with Windows 11 and I am facing a performance issue with MySQL I do ovserve on any other machine on the network and I not know how to fix.
The MySQL server is running on a ...
-6
votes
1
answer
161
views
How should I efficiently add all pairs in a key-value array to an object?
I have an object obj; and I then obtain an array arr of key-value pairs. Assuming that the key sets of obj and of arr are disjoint (i.e. no key appears in both) - how do I efficiently add all pairs in ...
Advice
0
votes
1
replies
50
views
Does the way a program is written/formatted affect how fast and large it is at compile time?
We all know that there's no wrong way to write code, and infinite possible ways to complete a task. Everyone codes differently.
There are of course many ways to shorthand code, so the same code can be ...
0
votes
0
answers
106
views
How efficient are pipes and threads in C compared to regular function calls or pure sequential code? [closed]
I’m currently studying Operating Systems at college, and my professor has started teaching us about threads and pipes in C.
His teaching style is very practical — he expects us not only to understand ...
0
votes
0
answers
50
views
Parallel Equations Expansion in TFORM
TFORM is considered a great tool for manipulating large and symbolic equations. In this thread, I’d like to share my optimization problem, which concerns a very simple operation — equations expansion.
...
0
votes
0
answers
20
views
FlashList cells rendering blank after EAS build with custom expo-build-properties config plugin
I have a FlashList displaying a complex list of items. To optimize it, I am using getItemType, overrideItemLayout, and keyExtractor. Everything works perfectly in Expo Go and on a local build (npx ...
1
vote
0
answers
49
views
Vue/Nuxt app loads slowly on client side -- how can I identify and fix performance issues?
I’m working on a Vue/Nuxt project where my client reports that the website is slow — especially when loading a selection window and when fetching JSON data.
However, the slowness is not very ...
Best practices
0
votes
0
replies
42
views
Why does my Next.js app’s performance drop significantly when using dynamic routes with large datasets and server-side rendering (SSR)?
I'm working on a Next.js 14 app with several dynamic routes (e.g., /product/[id]) that render product details from a large dataset (around 50k+ records) stored in PostgreSQL.
I'm using ...
1
vote
0
answers
72
views
Why the inflation time for a custom view is so long in Android using java xml?
problem
The time it takes to inflate is around 15ms ~ 8ms for a custom view, which is super long.
long startTime = System.nanoTime();
LayoutInflater.from(context).inflate(R.layout.view_profile,...
1
vote
0
answers
50
views
Why does fetch performance degrade over time in JBoss with MariaDB and how to properly configure fetch for direct JDBC Connection?
I’m running an application on JBoss 7 connected to a MariaDB database hosted on a separate AWS EC2 instance (c5.9xlarge). The SQL query execution itself is extremely fast (around 57ms), but when ...
0
votes
1
answer
133
views
Is there a way in Laravel to bulk-insert multiple records and get Eloquent models (all inserted fields) returned? [duplicate]
I have a scenario where I need to insert multiple records at once.
I want to achieve all two:
Bulk insert multiple records at once (performance).
Return Eloquent model instances for the inserted ...
4
votes
5
answers
366
views
How to compute the union and intersection of time intervals with covariates by group id?
I am looking for an efficient way to compute the union and intersection of time intervals (start–stop format) by group (id), while keeping the covariates associated with each interval.
Each patient (...
-5
votes
1
answer
213
views
Scalar product C++ vs Python
I'm writing code that must perform a dot product between a vector b and a matrix C, where the dot is performed between b and each line of C.
I made two implementation, one in C++ and one in Python. ...
1
vote
0
answers
132
views
Why does “Command Buffer Full” appear in PyTorch CUDA kernel launches?
I’m using the PyTorch profiler to analyze sglang, and I noticed that in the CUDA timeline, some kernels show “Command Buffer Full”. This causes the cudaLaunchKernel time to become very long, as shown ...
1
vote
0
answers
24
views
Why does the same YOLOv8n-pose model with different weights have significantly different inference speeds?
I’m testing YOLOv8n-pose models that share the exact same architecture, input size, hardware (GPU), framework, batch size, and precision settings. The only difference between them is the trained ...
-1
votes
1
answer
32
views
Debugging EAS: find_energy_efficient_cpu never called on Arm heterogeneous platform
I'm testing EAS on an 8-core machine (2 big cores, 6 little cores) with kernel version 6.6. I've verified that the system configuration is correct, but the core EAS function is never called. I've ...
3
votes
2
answers
148
views
.NET 8 console application slower after publish
I am confused why my application is somehow slower when I run it by executing the .exe file from the publish folder, compared to running it from Visual Studio debugger (F5).
I use .NET 8.0 and this is ...
0
votes
1
answer
192
views
Does source length of SQL functions matter
First, to define what I'm talking about, the "length" of a source is how many characters it has. Having more characters allows improving readability by using more descriptive function and ...
0
votes
0
answers
39
views
Is there a performance difference between writing bytes to RAM instead of longs?
My single threaded program allocates and initializes a volatile block of memory on an unspecified hardware architecture.
It then writes into this block in a loop using a stride equal to the cache line ...
0
votes
0
answers
42
views
How do I render multiple videos performantly?
I'm trying to render a scrollable grid of videos in React Native. Currently, I'm storing the videos as .mp4 files on Google Cloud Storage then fetching and rendering them using react-native-video's ...
-2
votes
1
answer
81
views
What means the key in the declaration of a STANDARD internal table?
I see in many existing ABAP programs that standard internal tables are declared without key fields, for instance:
TYPES type_itab TYPE STANDARD TABLE OF sflight WITH DEFAULT KEY.
DATA itab_0 TYPE ...