All Questions
Tagged with performance optimization
4,383
questions
0
votes
0
answers
12
views
vercel Serverless Function has timed out
I'm working on a Next.js project where I need to fetch markdown files from a GitHub repository using an API route. The API route fetches and processes the markdown files, then returns the data to be ...
-2
votes
0
answers
38
views
Optimizing Sorting Algorithm Performance for Large Integer Datasets in Java [closed]
I have implemented both quicksort and mergesort algorithms in Java, but they are not performing efficiently when sorting large datasets of integers (1 to 100,000). The sorting process takes longer ...
0
votes
0
answers
39
views
Performance Issue with Polyline Rendering on React Leaflet Map
I am experiencing a performance issue with the polyline component of the Leaflet map library in React.js. I have a large dataset of traffic congestion data (approximately 5,000 to 10,000 polylines) ...
-1
votes
2
answers
110
views
Fastest way to generate numbers up to a range in Python
I want to create a list of numbers that contains three consecutive 1s in its binary representation. To do this, I make set of number up to 2**n, and subtract it with a set of numbers that contains NO ...
1
vote
0
answers
26
views
Command getppid() takes 1 second each execution
I am trying to solve the high CPU issue, when tracing one of lsphp process, I see the command getppid() take more than 1 second each execution. See trace log below:
strace: Process 21945 attached
...
0
votes
0
answers
33
views
Looking for techniques to Optimize a Voxel Destruction System (Roblox)
I'm currently working on a voxel destruction system for a roblox game and I'm facing some performance issues. The system works as follows:
Hitbox Generation: A hitbox is repeatedly generated at a ...
0
votes
0
answers
20
views
Should I build a heuristic search like this?
I want to build a simple indexed search for a string I have (I know I could use a database for this - I just want to do it for learning purposes).
The most efficient way to do it that comes to my mind ...
0
votes
1
answer
20
views
Optimizing Fourier series computation time in python
I'm currently working on a code which requires the calculation of a
Fourier series more than a million times. Fourier series are
calculated using the same function below.
def fourier(ai, bi, angle, ...
3
votes
2
answers
94
views
Numpy `np.prod`, `np.all` are slower than explicit algebraic operations
In the below experiments, explicit algebraic operations are faster than np.all and np.prod.
What would be the reasons for that?
import numpy as np
import time
N_ROWS = int(2e5)
N_ITER = int(1e3)
np....
0
votes
1
answer
89
views
How to make this Python function even faster, lists processing
I was doing a Hackerrank question (I already finished that test, I am just asking because I am curious).
Most of test cases were successful but a few said that it took too long, so I had to optimize ...
0
votes
1
answer
65
views
Why does a for-loop copy not achieve peak CPU-RAM bandwidth on one core?
I would expect copying an array using a simple for loop to achieve my machine's peak bandwidth, but it does not. I ran the following example code with input 3GB, ensuring that it did not swap. It got ...
1
vote
1
answer
70
views
How to get video file duration from video URL
I am working on a C# application where I need to get the duration of a video file from a given URL. The video files are hosted online, and I need to fetch their durations programmatically.
I’ve ...
0
votes
2
answers
63
views
GridGain Throughput bottleneck using key value API
I am using GridGain Ignite as an in-memory database to serve data, data is stored as <Integer, String> key-value format, and each request contains a list of keys, I use
cache.getAll(keys).values(...
0
votes
0
answers
42
views
What performance disadvantages might I face with this approach to creating a library of iterators?
I'm working on my iterator library and I've come up with what I think is a convenient API. Here are some examples of how to use it:
// API usages
const iterable = [1, 2, 3, 4, 5, 6, 7, 8, 9];
// First ...
1
vote
2
answers
75
views
compare_exchange_weak() produces race condition with acquire-release on x86
Below I have a WriterLock struct. It's actually Reader-Writer but in this scenario I am only calling writer lock and unlock.
My unit test creates multiple threads, they wait and then request access to ...