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
1
vote
1answer
22 views

Sequence Generator from previous max sequence based on certain conditions

I'm new to VBA programming so the following code may look terrible which is why I want ways to understand how to better optimize it and other future codes. ...
4
votes
0answers
42 views

Count number of unique adjacent cells in a matrix

I want to write an algorithm to count how many islands are in a given matrix. Consider for example: ...
4
votes
0answers
45 views

LZ77 compression algorithm (general code efficiency)

I'm implementing LZ77 compression algorithm. To compress any file type, I use its binary representation and then read it as chars (because 1 ...
6
votes
0answers
30 views

Frequency analysis for simultaneous dice rolls

My professor told me to optimize my perl code, but he wouldn't tell me what exactly - just make it simpler. I changed some little things but nothing major. Am I missing something? The task was: ...
1
vote
1answer
52 views

Reduce time taken for VBA loop when copying multiple sets of input values, performing Excel formula calculations and recording results

My VBA code currently loops for 5,000 iterations and takes about 25 minutes to collect the output data in the Output excel sheet. Is there a way to reduce the time taken for instance by improving the ...
3
votes
3answers
86 views

MySQL/MariaDB Data extraction / String manipulation / “TopN” processing => Performance of C++ vs php vs python

EDIT1: Suspicion that mariadb++ is affecting my performance results compared to the raw "mariadb/mysql Connector-C"?? EDIT2: I did a barebones C-Only implementation and it comes in at 222ms vs the ...
2
votes
1answer
56 views

Finding the market price for each order at the time it was placed

I have two datasets. The first dataset “insideMarke1” contains the Best Bid / Best Ask (=BBA) data for a given day, starting at 8.00 am. Every time the BBA is updated, there is a new row with a new ...
5
votes
4answers
202 views

Program in JAVA to generate random alphanumeric string

This code will generate a pseudorandom alphanumeric string of given length. I would welcome suggestions on how to make it more random. Beyond that, have I made any convention violations, Exception ...
0
votes
0answers
32 views

Oracle of Kevin Bacon (aka Erdos number) [closed]

I have implemented oracle of Kevin Bacon by creating an edge table between the id of movies and actors and BFS. The run time even for an actor with Bacon number 2 is vast (>10mins). The SQLite query ...
8
votes
1answer
71 views

C++ Mandelbulb-set generator

This mandelbulb-set generator creates a .xyz file which contains all the points that are in the set which lie on a 3D grid. It does what it is supposed to. However,...
1
vote
0answers
30 views

Calculating the term of dfdeta [closed]

I am trying to improve the time running of this code. Some dummies variable is defined and it is just some part of a lot of lines of code, but I tried it with dummies variables. It takes too much in ...
-1
votes
4answers
57 views

How to optimize if statement in python from a parsing script [closed]

I have a part of my code I want to optimize. I use if statement to skip the analyze if the values are not the one I want. Just to help the comprehension, in my ...
8
votes
0answers
127 views

Solving Pentomino puzzles by using Knuth's Algorithm X

I wrote a program which solves Pentomino puzzles by using Knuth's Algorithm X. My priorities were: readability, straightforwardness and brevity of the solution, so I didn't try to squeeze as much ...
4
votes
5answers
191 views

Counting number of `1` digits in the value of \$11^n\$

I am trying to improve the efficiency of my code, The Question is: Given a value n, where n is in the range ...
6
votes
3answers
110 views

Optimizing a raycaster

I have finished a raycaster, and I want to optimize it before I add other features, such as variable height walls, texture mapping and lighting. I'd like someone to review the code so I can improve it ...
-1
votes
2answers
108 views

TrainSet Practice Problem from CodeChef

A dataset consisting of N items. Each item is a pair of a word and a boolean denoting whether the given word is a spam word or not. There shouldn't be a word included in the training set that's ...
-5
votes
1answer
47 views

Find pair of adjacent prime numbers in a two-dimensional array

Does anybody know how to find pair of adjacent prime numbers in two-dimensional array, quicker than this? I'm talking especially about this part which looks for adjacent numbers not about function ...
5
votes
1answer
46 views

Debian-Apache-MySQL-PHP-HTTPS version-agnostic environment bootstrapper

The following program is comprised of three files and is aimed to be used as a Debian-Apache-MySQL-PHP-HTTPS version-agnostic environment bootstrapper. It is aimed to be used on raw Debian systems (...
8
votes
3answers
623 views

Creating an affinity-matrix between protein and RNA sequences

I wrote an algorithm that analyzes protein-RNA interactions and I found that the following function is the bottleneck that causes performance issues: ...
6
votes
1answer
77 views

Portfolio optimization using genetic algorithm

I'm working on a (naïve) algorithm for portfolio optimization using GA. It takes a list of stocks, calculates its expected returns and the covariance between all of them and then it returns the ...
1
vote
1answer
81 views

Looking to Optimize VBA code with Varriant Arrays instead of Ranges

The code is doing everything that I need it to. It's taking much too long though upwards of a couple minutes to complete the macro. Does anyone know how I code optimize this VBA code to run quicker? I'...
6
votes
3answers
89 views

Performance in particles.js library

Hey I'm trying to optimise particles.js library from Vincent Garrau in order to get 60fps @ 500 particles ~. I've already refactored the code to use a quad tree instead but it does not seem to be ...
1
vote
1answer
56 views

Processes Files Using Subprocess and Os

This program I have written automates some of the more manual work in getting the results from my experiments. The idea is that I have folders and subdirectories in my main directory. Some of these ...
9
votes
2answers
401 views

Proper Case Conversion (Performance)

I wrote a simple function that converts an array of words into proper case (using bitwise operations) and returns the array. I performed a simple test using ...
4
votes
2answers
62 views

Merge duplicated cells in bulk per each column VBA

Need to merge data per column if records in the first column are the same. I wrote a VBA code and it works but it works very slow as it executes "merge" function per each row no matter if consequent ...
-2
votes
1answer
71 views

Parallel Calling of Function for Non-linear Solving

The end goal of my program is to use a non-linear solver to fit a set of parameters to my data set. I pull the data set from a database into a list sprays, then ...
2
votes
1answer
64 views

Scrape company data from Google search

I have written this code for crawling and scraping search results from Google. But it's super slow when I run it. What it does: read a pandas column, search values in Google and take the first result ...
1
vote
1answer
29 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
28 views

Save points cloud in PLOT3D format

I have the following function to save points cloud in PLOT3D format: ...
4
votes
0answers
65 views

Extracting cycles from directed graph with max degree 1 and then performing set cover on cycles

I'm trying to solve P1243E in an efficient manner. The problem in simple words is: Given \$k\$ boxes, \$i\$-th box with \$n_i\$ numbers. All numbers are distinct. We need to select one number from ...
9
votes
3answers
1k 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
26 views

Correctness and Performance of graph plotting on R

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

Optimizing a TFxIDF vectorization - Python 3.x [closed]

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
55 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
58 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
22 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
70 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
102 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
57 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
441 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
38 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
970 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
73 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
3answers
190 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
136 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
85 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
77 views

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

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 ...