Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

query optimization and indexing

database relations can be found here http://www.tpc.org/tpc_documents_current_versions/pdf/tpc-h_v2.18.0.pdf ...
4
votes
1answer
25 views

Save points cloud in PLOT3D format

I have the following function to save points cloud in PLOT3D format: ...
8
votes
3answers
939 views

Counting without zeroes

Below is a python script that generates the sequence ['a', 'b' .. 'z', 'aa', 'ab' .. 'az', 'ba', 'bb' .. 'zz', 'aaa', 'aab', ..] This is essentially counting in ...
0
votes
1answer
17 views

Correctness and Performance of graph plotting on R

Current State: I have two CSV files, their sample attached below: FileOutputWithoutBuffer-Metrics.csv ...
3
votes
1answer
35 views

Optimizing a TFxIDF vectorization - Python 3.x

I am attempting to train many classifiers to test their performance with classifying tweets as being from a political bot, or not (a binary 0 or 1 classifier). My ...
2
votes
2answers
44 views

OpenCV calculate center of mass for a single contour

I was recently going through some OpenCV code that finds the center of mass in a contour and realized there is potential room for optimisation. What I noticed looking back through my code is when I ...
5
votes
1answer
46 views

Remove words from an exclude list in each row of a pandas.Series

I am trying to remove all occurrences of the words I collect in the list exclude from every text note. This is my approach. ...
1
vote
0answers
20 views

Storing multiple translations for retrieval

I've designed a database schema to store multiple translations with the objective of it being easy to retrieve data and add more translations if ever needed in the future without needing to make any ...
2
votes
2answers
44 views

Speed performance of picking unique value from binary matrix file

I wrote this code to read a square matrix saved as binary file, that it can be int, uint, float etc... to pick a value from the matrix at given row ...
3
votes
0answers
67 views

Making a fast Mandelbrot Fractal viewer

I'm making a Mandelbrot set viewer in JavaFX. It takes a while, like maybe 5 seconds to finish. Here's my code: ...
2
votes
1answer
86 views

Excel VBA code that writes to a Table - much slower than writing to a simple range

I have a piece of code (below) that checks a data table (45,000 rows) to see if the row matches any entries in a range elsewhere on the workbook (using custom functions). The routine then creates an ...
1
vote
1answer
56 views

Reduce the execution time utilizing two apis

I am new to python. I have been given a task to verify the data from 2 apis which give similar data but in different format i.e. Json and XML. I have written the code but it is taking too much time to ...
8
votes
1answer
373 views

Optimize Performance of Region Checking in List Comprehension

I am modeling a linear process at a number of equally spaced time steps. I have a large list (~70k elements) which corresponds to a location at each time step, ...
1
vote
0answers
36 views

Binary Heap module in Typescript/Javascript supporting min-heap and max-heap

About binary heaps: https://en.wikipedia.org/wiki/Binary_heap The purpose of this module is to allow quick and efficient priority queue management, compared to linked list. Efficiency: insert: \$O(\...
2
votes
1answer
47 views

Retrieving HKLM nodes of Windows10 Registry

I have used below code, code is working fine, also retrieved the data, but there are performance issues. Retrieving the HKLM registry nodes is taking around 6 mins time. Please suggest any solution. <...
6
votes
3answers
959 views

Receive a list of names and return a list of users - HackerRank test

So, few months ago I did a HackerRank test for a company. The problem was to create a function which receive a list of names and returns a list of unique usernames. For example: For the list of <...
2
votes
2answers
71 views

hash image url and if valid store image url

I am trying to get all image urls which are valid and unique.To make sure i wont end up using the same image again i calculate hash of the image and store it in a text file and read the text file ...
3
votes
2answers
155 views

A prime numbers enumeration optimized for speed

I know there is this thing called "Eratosthenes" but that requires the allocation of a large array while I want to find (small) prime numbers fast, yet without needing too much memory. So I wrote ...
6
votes
2answers
129 views

Find the largest sum of any slice inside an array

This is the 26th exercise I solved from Codility. It scores 100%. I think I improved a lot since I started with this lessons, around 2 months ago, but still every post I made had things to be improved....
6
votes
2answers
81 views

Heap-allocated fixed size array with memory-reusing type transformation function

I want to use an std::array, but am operating on sufficiently large arrays that stack allocation is not reasonable (and fails using default stack size). I also ...
0
votes
0answers
65 views

Recursion on graphs - networkx VS adjacency lists with native lists, sets or numpy vectors ( python ) [closed]

hope someone can help me out in reviewing this code to make it faster. My goal is to create a graph recursively: query for a node and its neighbors from a db (not present here) add it and its ...
2
votes
1answer
74 views

Speed up python program for computing shortest paths by 100+ times

This code inputs a weighted edgelist, positive and negative sentiment seed words, and a target word. The program computes the sum of the weights along shortest paths from the seed words to the target ...
5
votes
3answers
102 views

Image filtering application

I'm building an image filtering application, and I'm new to the Java frameworks that I need to do so. Right now, I can apply a simple 3x3 kernel blur to my thing by overwriting the RGB values of the ...
3
votes
1answer
53 views

Count the number of leaders in both sides (slices) of an array in C#. Codility EquiLeaders task

EquiLeader A non-empty array A consisting of N integers is given. The leader of this array is the value that occurs in more than half of the elements of A. An equi leader is an ...
0
votes
1answer
67 views

R: Optimize algorithm speed that estimates hourly temperature and relative humidity

I built an algorithm to estimate real-time temperature and humidity values ​​based on daily values ​​of the same variables. The algorithm works, however the speed with which it processes the ...
4
votes
1answer
125 views

Dapper “async” and “await using”

I have been building my data access layer and performance is key for the project I am working on. I have chosen to use Dapper and dotnet core 3. I want to make use of the latest and greatest async ...
0
votes
1answer
85 views

SHA256 hash bruteforcer

I made a SHA256 hash bruteforcer as my first program in Rust. It's very specific to what I'm trying to bruteforce and I'll probably never find it. I translated it from Python to make it faster, but ...
3
votes
2answers
84 views

Finding root of strictly monotonic function by bisection

I need to find a root of strictly monotonic function f (only raising or only lowering). There is only a one root of a function. If given range from a to ...
3
votes
1answer
104 views

Minimax algorithm for tic tac toe in Python

I am using minimax algorithm (for now without alpha beta pruning) for AI in tic tac toe game in Python and Numpy. It's working, but very slow, so I would like to optimize it. A few rules for current ...
4
votes
2answers
155 views

two-sum algorithm

Can someone help me in optimizing the code here? This is the original question Given an array of integers, return indices of the two numbers such that they add up to a specific target. ...
3
votes
4answers
120 views

Multi-threading slower than expected from single-thread loop [closed]

The following code is an experiment that I ran to play with the advantages of multi-threading in C++. Given a number 10000000000 it calculates how many numbers are ...
11
votes
5answers
3k views

Brute-Force algorithm in C++

I wrote a brute-force algorithm which shall find all possible combinations of ASCII-values that can sum up to a specific value (int hashval). The algorithm is ...
3
votes
0answers
17 views

Speeding up a complex array function in excel

I have a complex array function that takes way too much time to calculate, which is why I'm looking for ways to make it more efficient. Basically, I have a transaction sheet in which I list all goods ...
1
vote
1answer
56 views

Codility's stonewall 100% solution - different paths such as if,else if,etc, do the same thing

Here is the task description for the codility's stonewall problem. I would like to get a feedback on my code, and I specify at the bottom what the title states. (I had to make the figure by hand, ...
2
votes
3answers
201 views

Merging sorted integer vectors in C++

Given multiple sorted integer vectors, the goal is to merge them into a single vector and eliminate duplicate values. We've already achieved some improvements over the most simple approaches, but ...
0
votes
0answers
29 views

Incremental Floyd Warshall on directed graph

Given a directed graph with \$n\le 500\$ vertices I want to find sum of minimum distances between each pair. This can be done using Floyd-Warshall in \$O(n^3)\$. Now I remove a vertex and do so again ...
4
votes
1answer
50 views

Load excel sheet to data frame

I have a bare-bones example of how I plan to load excel sheets into pandas data frames. However, the code runs unexpectedly slow. I'm open to suggestions on ways I can speed this up, even converting ...
4
votes
0answers
57 views

Evaluating a previously calculated gradient function

I am trying to perform optimization using a surrogate model instead of the real function and for that, I need the gradient of my LSTM model with respect to the input. In this case, I have 3 features ...
3
votes
0answers
93 views

Money change/minimum coin algorithm

How can I speed up this code? ...
1
vote
0answers
29 views

Efficiency Heuristics for Adding Elements to Lists in Python [closed]

Suppose my goal is to add elements to list in python if they pass a conditional. There are many ways to do this and I show some. Would it be possible if you could review each block and describe its ...
0
votes
1answer
80 views

Fibonnaci sequence calculation [closed]

Below are two ways to calculate an element of the Fibonacci series. Can someone please help me understand why fib1 is so much faster (over 60x) than ...
2
votes
1answer
48 views

Find all palindromes in the danish language

I made a program to attempt to find all palindromes in the danish language. Words.txt contains about 50.000 lines of danish words. Palindromes.txt is empty initially. Im running the program on a ...
3
votes
1answer
43 views

Codility voracious fish are moving along a river, solution in C#

This is the task's description. My code gets 100% task score. Is it good code yet? (I think I'm getting a lot better, since I started solving this codility's exercises and posting here, but I always ...
2
votes
0answers
54 views

XXTEA encryption implemented in modern C++

At the company i work we have a system where an user is presented with a question and some alternatives to choose from. The question and answers are generated at runtime. In order to simplify the ...
5
votes
1answer
33 views

Finding the largest jacobian in a finite element mesh

So I'm trying to implement the following problem in a couple of different languages to get a rough idea of how different languages work & feel. I'm completely new to C, and this is the first code ...
3
votes
1answer
49 views

Store personal data for later use

I'm new with Ruby and am trying to improve my coding skills. This program gets personal information for three people, and then prints them. It works, but I'm sure it's not the best and certainly not ...
1
vote
0answers
47 views

longest palindrome code in C# takes time out on LeetCode

I like to request a review of the code below, which is my attempt at answering the question at here on LeetCode site. The code passes 43 tests, but it times out on the next one. I copied and ran the ...
3
votes
2answers
119 views

Determine the length of the largest contiguous segment

Problem Link- https://www.hackerearth.com/challenges/competitive/october-circuits-19/algorithm/ap-1-f43562f4/ Problem Statement : You are given an integer array of size A. You are also ...
2
votes
1answer
76 views

Speed up a while loop that conditionally creates a new variable in R

I would like to speed up the following code in R. This is a loop to define new individuals (column newID) when the variable ...
3
votes
0answers
25 views

Procedural Generation

I'm currently working on a procedural generated terrain. I've written the Chunk script, and it works great. When I generate a few chunks in Unity, it runs alright, but it could definitely run better!...