102,852 questions
3votes
2answers
81views
What is time complexity of LINQ Order()/OrderBy() followed by Take(k)?
What is the time complexity of the following code in C#? array.Order().Take(k).ToArray(); Will LINQ treat this as QuickSelect? Or, will it perform full array sorting with the complexity O(n log n)?
-1votes
0answers
35views
Varhandle field must be volatile or not [closed]
I'm unsure about the proper use of volatile, because sometimes the field is volatile, sometimes not. I know what volatile is for, but I just have consideration how Varhandle resolves access to field. ...
0votes
1answer
74views
Java ArrayList and LinkedList performance [duplicate]
I know that it's a never-ending question that comes back every now and then, but I'm really confused about these two. This is what I understand about them. In theory: LinkedList is faster at adding ...
2votes
1answer
83views
Why the performance is bad if I use HashMap to solve Codility problem MinAbsSum?
Regarding the Codility problem MinAbsSum at https://app.codility.com/programmers/lessons/17-dynamic_programming/min_abs_sum/, the performance is bad if I use HashMap to solve the problem. I expect the ...
0votes
1answer
29views
State updates causing excessive re-renders in complex React dashboard with nested components [duplicate]
I'm working on a complex analytics dashboard built with React and TypeScript, which involves multiple nested components. I'm using a combination of state management techniques including React Context, ...
-4votes
0answers
30views
How can I implement an efficient undo/redo system for complex state changes in a React app without using external libraries? [closed]
I’m building a React application with a complex form editor where users can make multiple types of changes (e.g., add, delete, modify fields). I want to implement an undo/redo feature to allow users ...
-3votes
1answer
35views
Train/Test Split Confusion [closed]
Users I am working on a machine learning project where I use StandardScaler to normalize my feature set. After scaling the data, I split it into training and testing sets using train_test_split. ...
1vote
2answers
51views
How do you efficiently find gaps in one list of datetimes relative to another?
I have datasets from multiple instruments with differing, but hypothetically concurrent datetime stamps. If date from instrument A does not correspond to any data from instrument B within some ...
1vote
0answers
80views
Excel/Word macro slows with iteration
This macro is used in Excel to data mine from Word documents. The macro iterates through a list of files to process. The first two or three files take 10 seconds each. After that each file takes 3.5-4+...
1vote
0answers
78views
Sending a 9MB JSON file takes 3 seconds
I have to provide data from a MySQL database, so I'm extracting that data with a traditional PHP/MySQL prepared statement, turning it into JSON with json_encode and echoing it. This takes almost three ...
-1votes
0answers
29views
Inconsistent GPU Usage in Colab Pro — Same Code, Different Performance [closed]
I have purchased Google Colab Pro and I’m using it to run a notebook based on a code from Kaggle. I enabled the GPU runtime (Runtime > Change runtime type >A100 GPU) and confirmed that the GPU ...
-3votes
0answers
28views
Optimizing weather animations (snow/rain/stars) for mobile - alternatives to 100+ CSS animated elements? [closed]
I'm building a weather-themed portfolio with interactive animations that must maintain performance on mobile devices (≥ iPhone 8/Android 9). While I've made optimizations, I'm hitting performance ...
-1votes
1answer
40views
nodejs event loop lag 300ms and huge request latency [closed]
I have a next.js website that under the load 80 requests per seconds (for one pod) shows huge latency 20-30 seconds to handle a simple request like API call. I checked event loop lag and under the ...
2votes
1answer
119views
Collections.remove() vs Iterator.remove() performance-wise
I am traversing a list and want to remove a certain element that matches a condition. I also want to return that element. There are two ways I've come up with to do this. First: for (int i = 0; i < ...
1vote
0answers
47views
Why does async/await sometimes lead to slower execution than raw Promises? [closed]
I've been working with JavaScript for a while and often prefer using async/await for readability. However, I recently ran into a situation where switching to raw Promises (using .then) actually ...