Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [performance]

Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.

0
votes
0answers
10 views

Persist payload containing multiple items using EF Core Performance Improvements

I have an .NET Core EF application, setup as Database first, that is supposed to take in a payload containing items to be persisted to my database. They payloads can be huge containing multiple "...
3
votes
1answer
17 views

Processing file inclusion directives using mutual recursion

I am preprocessing a set of files where one file is included in another file with an include tag like shown below: file A ...
1
vote
4answers
81 views

Find the thousandth integer without the digits 3, 4, and 7

I have to find the thousandth number (excluding numbers 3, 4, 7) but it's taking a long time, about 9 seconds. I'd like to find out how to improve performance. ...
5
votes
2answers
48 views

Simulation of spring-loaded inverted pendulum

I've finally committed to moving to Python 3 from MATLAB. I'm currently porting my MATLAB code, and I'm sure I'm missing a lot of common best-practices. For reference, I'm simulating a spring-loaded ...
3
votes
3answers
371 views

Finds a Character based on distance and health

I need to improve the efficiency of my program and, using the profiler, have narrowed the problem down to 2 key areas, but I am having trouble coming up with ways to make the program run better. ...
2
votes
1answer
37 views

Binary genetic programming image classifier's fitness function

I am trying to figure out how to improve my binary image genetic programming classifier's fitness. It takes images and classifies them if it has some feature X or not in it. These are the main ...
0
votes
1answer
39 views

GUI that searches files using user inputted search strings [on hold]

Basically, I've got a GUI where the user can select text files, enter in strings (that may or may not contain wildcards) and search those files for those strings. Currently, I take the user inputted ...
0
votes
1answer
64 views

Forming the best possible poker hand [on hold]

This is what the function is doing: it gets two arrays of tuples with 5 items each - hand = [H1,H2,H3,H4,H5] and board = [B1,B2,B3,B4,B5] What I need to do is check all arrays formed by 2 items from ...
1
vote
1answer
44 views

Improving speed of data clean process in vba

My code does exactly what I want it to. However, being relatively new to VBA, I feel it could be a lot more efficient - namely I think I have overused loops and worksheet functions which are slowing ...
6
votes
3answers
2k views

Extract all GPU name, model and GPU ram

I currently use this code to extract the required GPU data. Can you review this method for efficiency or best coding practices? Code ...
2
votes
1answer
44 views

VBA - If value in sheet1 found in sheet2, then delete data from sheet2

I have 2 sheets setup: Exclusions and Issues Issues has a list of CASE ID's and Columns that list the "Issue" Exclusions will be populated with CASE ID's that are to be excluded (and removed) from ...
0
votes
2answers
83 views

User interface HTML string generated using PHP

Goal This is very basic beginner script, only for prototyping, probably never to reach alpha/beta prototyping/production, is being designed/tested for performance. Its performance quality might be ...
4
votes
1answer
41 views

Optimizing my 2D Ising model code in Julia

I'm just starting to learn Julia, I work primarily in physics and am used to writing most of my code in Fortran90 and occasionally Python for Tensorflow (also Mathematica but that's less relevant). ...
5
votes
1answer
58 views

Extracting watermark from a video using Python

I'm extracting a few frames from a video: Comparing the similarity or equality of pixel color (from first two images) Saving to a new image Comparing the new image (conjunction of first two images) ...
1
vote
1answer
137 views

Solution to Codejam 2019's Pylons

I'm trying to solve Pylons from the 2019's round 1A. The analysis suggests that a brute force approach should work. However, my Python 3 solution doesn't pass the 2nd test case. Can I make it faster ...
1
vote
0answers
36 views

Python - Speed up nested for loops in numerical experiments

I am trying to run some numerical experiments, and wondered if there was any way to run my code faster. The function runs over combinations of several parameters so in my mind I thought the best thing ...
2
votes
0answers
33 views

Trying to speed up doing a regex_search function with X strings on Y files

The point of this project is to be able to create an excel configuration file where the user can input search strings and search files, both potentially having wildcards, and search those files for ...
2
votes
1answer
132 views

Faster way to 3 nested for loop python

I am calculating parameters for a time series and the data size is very big. How can I make my function faster? The following function, param, calculates parameters ...
1
vote
1answer
60 views

Remove nested for loops in python [on hold]

I have the following working code, but it is too slow because I have to run the same code for several files inside a folder. Please help me avoid the nested for loop or make it more efficient. ...
2
votes
1answer
22 views

Leftmost bisect search to find valid perfect square

I am working on Valid Perfect Square - LeetCode and wrote a standard leftmost bisect search to solve the problem: ...
3
votes
1answer
55 views

Google Kick Start Practice Round 2019 - Mural

My code exceeds the time limit on the second test set. A suggestion/hint of a better algorithm would be appreciated. Problem Thanh wants to paint a wonderful mural on a wall that is N ...
2
votes
2answers
47 views

Fastest way to find dataframe indexes of column elements that exist as lists

I asked this question here: https://stackoverflow.com/q/55640147/5202255 and was told to post on this forum. I would like to know whether my solution can be improved or if there is another approach to ...
6
votes
1answer
71 views

Per pixel Image Computation with Gamma Correction in OpenGL and C [closed]

I've been working on a way to optimize pixel computation in OpenGL with C. If this information helps, my current environtment = Linux (terminal) + GPU (Nvidia 1080Ti). I'm working with old OpenGL (...
1
vote
1answer
23 views

slow JavaFx PostgreSQL CRUD app with complex object

I've created a JavaFX app to the data about Vessels, Employees and Jobs. The current version works but it is quite slow which I need to fix. I understand the root of my problems but I do not know how ...
1
vote
1answer
77 views

Sum of number's quotients when divided by exact powers of 2

Problem I have written code to solve this challenge: Given a formula: GCD(x,y) means the GCD (Greatest Common Divisor) of x and y. For example: if N=2, then: f(2) = 1/GCD(1,...
0
votes
0answers
24 views

Clarification on running multiple async tasks in parallel with throttling and polly policies [closed]

I'm trying to run multiple async Tasks in parallel with throttling using polly AsyncBulkheadPolicy + WaitAndRetryPolicy. My understanding so far is that the policy method ExecuteAsync does not itself ...
2
votes
1answer
49 views

Speed up fast poisson disk sampling generator in Python

I wrote a generator class which implements Fast Poisson Disk Sampling algorithm in Python. I did some optimizations like, x ** 2 -> x * x, using unpacking ...
2
votes
1answer
58 views

Pandas nested loop which checks if values from one series are in another series

I have two different series in pandas that I have created a nested for loop which checks if the values of the first series are in the other series. But this is time consuming in pandas and I cannot ...
4
votes
2answers
54 views

Best way to retrieve music metadata from audio files?

I am using the music metadata-browser npm package to retrieve audio metadata from files. This library is being used in an Electron and React desktop app. To get the metadata of audio files, (and add ...
3
votes
2answers
99 views

Trip planning algorithm

I was presented with an interview question described as follows: Receiving an int[] A of cities, where each A[i] has an appeal ...
2
votes
0answers
15 views

spark takes long time for checking an array of items present in another array

I am new to spark. I have two dataframes df1 and df2. df1 has three rows. df2 has more than few million rows. I want to check whether all items in df2 are in transaction of df1, if so sum up the costs....
-1
votes
0answers
57 views
2
votes
1answer
39 views

Leetcode: Detecting duplicate elements in an array within a k-element window

Upon solving the problem 'contain duplicates` in leetcode: Given an array of integers and an integer k , find out whether there are two distinct indices i and j in the array such that nums[i] = ...
1
vote
1answer
34 views

Loop through data layer and display dynamic content [on hold]

The purpose of the pricingTest object is to grab pricing information from the dataLayer on the page and render content blocks accordingly. My goal in posting this is to hopefully receive some feedback ...
4
votes
1answer
176 views

Best way to performance permutations

This has been my white whale for a while, the idea is convert all the symbols to the goal symbol using all the pieces. I did an algorithm like 5 years ago (now is lost) and reach lvl 48 but got stuck ...
3
votes
1answer
28 views

Summing up students by the topics they studied and the marks they got

I wrote scripts that sums up the students and their grades. It uses four csv files. students marks tests courses . ...
2
votes
1answer
74 views

Cache with limited size; If full remove the oldest

Here is a class that stores a single value into the limited cache. If cache is full, it will remove the oldest element to make a space for a new value. I'm using 2 structures to accomplish this ...
3
votes
1answer
54 views

4 solutions to leetcode 202. Happy Number have almost same performance

I am working on an easy math question Happy number Happy Number - LeetCode Happy Number Write an algorithm to determine if a number is "happy". A happy number is a number defined by ...
1
vote
0answers
25 views

Scipy basinhopping custom step update and constrained looping

I am searching for the global minimum of a certain function and trying to use its gradient (here same as Jacobin) to guide the step counter. However, my x is fix ...
2
votes
1answer
37 views

Google Apps Script to create an invoice

I am using Google Execution API to create an invoice and it's a small part of a bigger system. However, my boss is pretty displeased at the total execution time before an invoice is generated. It ...
1
vote
0answers
13 views

Optimizing Tab Control With AutoIT

So I wrote this to simulate a program that would have a start and stop feature, and has a tab design. Right now there is a tab that has a ...
2
votes
1answer
37 views

Kahn's algorithms to arrange CouseSchedule

I wrote a solution to Course Schedule II - LeetCode There are a total of n courses you have to take, labeled from 0 to n-1. ...
1
vote
1answer
37 views

Maximize Path Value

I recently had to code an algorithm that will, for an input of: matrix of up to 5x5 size and a defined path length, find a path of this given length from the first top left matrix element (0, 0) to ...
3
votes
2answers
108 views

Efficient way of flat mapping a range of a multidimensional random access collection

I've recently answered a question about reading elements from an array of arrays. A way it could be interpreted is that the OP wanted to read a range that could span over multiple subarrays of the 2D ...
2
votes
1answer
27 views

Function figuring out which close-by value comes from which input value

I would like to optimize the below traceback function. This function is part of an elementary step of the program and is called a lot... ...
5
votes
2answers
60 views

A recursive solution to symmetirc tree

I tried to solve a symmetric tree problem Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree ...
5
votes
2answers
109 views

Programming Challenge from Kattis: Watchdog

I've tried to solve the kattis-challenge called Watchdog. My code works just fine, but it was too slow on the last test. I'm wondering if anyone sees any big algorithmic performance issues. A short ...
0
votes
1answer
22 views

Searching for combinations of words and numbers

My model called Customer contains a method called generate_fields which creates records based on its return values. ...
7
votes
2answers
161 views

Apply function to every subset combination and return square matrix

I do not know how to do this without four nested for loops. I'd like to apply a function to every possible combination of subsets for ...