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
39 views

String search using Rabin-Karp algorithm

I am trying to solve a needle in haystack using Rabin-Karp algorithm, but for large inputs my code takes way too long time. Here is the part which apparently is too slow: ...
5
votes
1answer
4k views

Code Vita: Chakravyuha

Problem Statement A Chakravyuha is a wheel-like formation. Pictorially it is depicted as below A Chakravyuha has a very well-defined co-ordinate system. Each point on the co-...
0
votes
1answer
43 views

Absolute Permutation | Hacker Rank: Any way to make this python code faster without changing it's whole logic?

https://www.hackerrank.com/challenges/absolute-permutation/problem I know that if you work out the math and logic first, the algorithm can be simplified greatly (shifting indices), but is that the ...
3
votes
0answers
46 views

Machine Learning Loss Functions In C++

I was looking for C++ versions of the machine learning metrics implemented in Python's sklearn, but they were surprisingly hard to find. I came across a website that had most of the loss functions ...
4
votes
2answers
230 views

Remove matching lines from all files

I have written a Python3 program that looks for matching strings and removes them from files. ...
11
votes
2answers
1k views

Multi-threaded web server serving HTML, images, etc

I have a web server that can send websites, images, mp3 and other things and I was wondering how I could improve the code and make the server more efficient. ...
2
votes
0answers
70 views

Evaluate performance of DLL calls from VBA

While playing with a VBA project involving Windows APIs, I have noticed some odd behavior: API calls under Excel 2016/VBA7/x64 appeared to be much slower than under Excel 2002/VBA6/x32. Since I ...
11
votes
1answer
13k views

Tkinter GUI for making very simple edits to pandas DataFrames

(NOTE: Python2 only) It is part of a separate application that allows users to interact very loosely with different databases and check for possible errors and make corrections. ...
2
votes
2answers
62 views

Shunting Yard Calculator - Extended to negative, complex, etc

This project is based off the shunting yard algorithm and has additional features such as negative value parsing. It's like a scientific calculator. I am looking to improve this project by getting rid ...
0
votes
1answer
34 views

Search in circular sorted martix

The method is given NxN matrix always powers of 2 and a number,it will return true if the num is found example for 4x4 size: ...
0
votes
0answers
16 views
4
votes
3answers
124 views

Improving generic A* algorithm performance

Here is my A* algorithm. I tried hard to implement it generically, but come up only with one idea to use lambdas for heuristic and next nodes (neighbours / successors) functions. I know that using ...
1
vote
1answer
64 views

PHP Group associative Array duplicates and make subarrays of different values

I have this type of table: ...
0
votes
0answers
15 views

OCaml implementation of two-sum

I'm implementing some simple algorithms (e.g. two-sum) in OCaml and I am unsure why my OCaml solution is running much slower than the equivalent Python version. My OCaml version: ...
2
votes
2answers
145 views

Sum of 2 arrays using multi threading

I'm trying to implement sum of 2 array using multi threading. I expected that when I use more threads it will be faster than when I use one thread, but that isn't the case. ...
2
votes
0answers
59 views

Archiving / Moving Data from one database server to another database server

I am working on an SMS marketing project based on Yii2 Framework (PHP 7.3 & MariaDb (innodb engine)) where we have to move the logs from different tables to the archive db, which is total a ...
5
votes
1answer
178 views

Optimized way to save list of files

I would like to optimize the way that I save files. Each second I save lots of strings in different files. What I want to do is bunch up these IO tasks so they happen in bursts, instead of spread out ...
6
votes
3answers
232 views

Count the numbers in a range in which the sum of the odds digits have the same parity of the evens one

As already written in the title I want to count the numbers in the range (x+1, y) where x and y are integers, in which the sum of the digits in odd places have the same parity of the ones in even ...
2
votes
2answers
111 views

Forms to enter trading information

My project has grown for a year and now comprises of 19 standard modules, 7 class modules 11 forms. Some of the forms appear to freeze when called but, in fact, they are just slow to respond, taking a ...
4
votes
1answer
89 views

Gear Shift Indicator using Hall Effect Sensors & 8x8 LED Display

I wired up a Gear Shift Indicator for my dad's car to display what gear it is currently in, and showing changes with animations (sliding up and down as appropriate, with a few bonus ones for fun at ...
0
votes
0answers
44 views

finding a value in circular two dimensional array [closed]

given a number and two dimensional array the method will check if the number is in the array the array is quadratic circular size n x n and each quarter of the array contains bigger numbers that the ...
0
votes
1answer
99 views

FizzBuzz Optimisation | Modulus vs Decrement Operator Performance

This is not the typical debate in FizzBuzz code about how to handle repeated if statement. I believe that it is a matter of personal preference. I am here to ask about the choice of repeated ...
0
votes
0answers
70 views

Thinking about the efficiency of my chess program [closed]

I am currently working on a chess console app. However i feel like i got some inefficient code. For example: In order to find out whether an enemy is in check I start iteration over all pieces and all ...
0
votes
0answers
6 views

Updating an array inside a document using Mongoose and ExpressJS

The following is a put controller I wrote to update a document. What I am updating is a particular array in the Model: The issues array. The schema for the Model is ...
1
vote
0answers
50 views

In a search of perfect batch script for editing the hosts file

I want to edit Windows hosts file in the best way for the end user, using a batch-only solution. I ended up with this script, which works fine, but since I don't have enough knowledge, the syntax is ...
1
vote
1answer
44 views

Calculate correlation of genes stored in dataframe rows

This script is to calculate the Spearman correlation of genes that are stored in rows of a pandas dataframe. The original df has around 2000 row names. With my current code, this requires 2000*2000 ...
2
votes
1answer
85 views

Finding better logic for addition and removal of Nodes in a Linked List

Consider the following piece of code I wrote (a templated Linked List): ...
1
vote
1answer
71 views

Python IPv6 verifier, parser and converter

This is a simple Python 3 program that verifies whether a string is a valid IPv6 address or not, parses IPv6 address to its hexadecimal and decimal values, and converts an integer to IPv6 format. I am ...
1
vote
2answers
93 views

HackerRank "Array Manipulation" challenge (using Microsoft concurrent extensions)

I've been practising my coding skills because I have an interview coming up. The HackerRank challenge has 16 test cases; the code passes 9 of them and the other 7 time out. If you go to HackerRank ...
0
votes
1answer
71 views

Find the minimal distance between two values in an array [closed]

Given 2 values and an array, I must return the minimal distance between the indices of both values, as efficiently as I can in terms of run time and space. This is my solution: ...
1
vote
1answer
63 views

Web Scraping DOL with Selenium

This is my code to extract data from the DOL website for a project I'm doing for my portfolio. The code does extract all of the data that I need, however it runs really slowly. I think it took like 15 ...
4
votes
2answers
1k views

VLOOKUP Macro to reformat data between sheets preserving the connection to the source

Hello I'm relatively new to VBA and I have this macro to VLookup information into corresponding cells in the sheet that works, the issue is that it depends on a For Loop to iterate through 10s of ...
0
votes
0answers
35 views

Solving a linear system with Gaussian Elimination

I decided to implement a solver for linear systems of equations based on the gaussian elimination and reduction to upper triangular form. The gaussian elimination is quite simple to implement but the ...
0
votes
2answers
95 views

Calculate square of (sum of even-indexed) - (sum of odd-indexed) subarrays from an array

Find all subarrays from a given array in the least possible time complexity. Requirement: calculate the square of (sum of even-indexed elements) - (the sum of odd-indexed elements) of al the subarrays....
3
votes
1answer
74 views

Segmented Sieve of Eratosthenes with wheel factorisation

Problem I have a project in which I implemented variants of the Sieve of Eratosthenes as well as benchmarking and profiling harnesses for these (which can be ran with ...
0
votes
1answer
80 views
0
votes
0answers
16 views

Why is this MongoDB query so slow in comparison to python + in general?

There are 1.3M documents in my collection (5.0 and hosted directly on mongodb.com) and there is an index on "topic" and a combined index on "topic" and another field. However the ...
1
vote
2answers
96 views

Improving upon basic MVC in PHP

I've put together a simple CRUD application to keep track of my library of books in an effort to learn the model-view-controller pattern, as well as better myself at PHP. Everything I have works so ...
0
votes
0answers
62 views

Kosaraju's algorithm is too slow

I just implemented the Kosaraju's algorithm in Go. I tried to implement the same algorithm that is described in the relevant Wikipedia page: ...
-1
votes
1answer
87 views

HOW can I optimize this FFT C++ Code without using external libraries? [closed]

I have this assignment with the goal of improving the performance and execution time of a FFT C++ code without the use of external libraries. The code is as following: ...
3
votes
1answer
91 views

Simple stack based interpreter

This was inspired by the question Passing Programs To A Stack Machine Implemented In C++. I wanted to make it a bit smarter by adding control functions: instruction op1 op2 op3 description ...
1
vote
1answer
68 views

Optimize "nearest" Element query prototype

I have devised a recursive function to grab the "nearest" element. This is a bit different than Element.closest, because instead of traversing just the ...
16
votes
3answers
1k views

Razzle Dazzle simulator

Inspired by the video from Scam Nation and James Grime from Numberphile, I tried to make a Razzle Dazzle simulator. Razzle Dazzle is a scam in the form of a game. Per turn, the player pays a fee and ...
3
votes
4answers
123 views

Passing Programs To A Stack Machine Implemented In C++

I'm learning C++ by implementing a previous project I did in Python. This is a simple stack machine which evaluates mathematical expressions, e.g. pow(9, 12). The code to run this on the stack ...
3
votes
2answers
356 views

Asynchronous and recursive word square generator in C#

Overview I've created an asynchronous and recursive method of generating word squares, of any size (known as the order of the square), from a known word list. If you're unfamiliar with word squares: ...
0
votes
1answer
62 views

What do you think about my program and what can I implement to make it more efficient? (ex. runtime wise) [closed]

I'm taking a course and I've just completed a challenge. The program runs well and it does everything I told it to, but I would like suggestions as to what can I implement to make it better (ex. ...
0
votes
0answers
12 views

Optimizing data processing of netCDF file

I am extracting/processing some data from a netCDF file. It is the first time I am processing the netCDF file. The data processing is super slow, and I would like to learn how to speed up the process. ...
1
vote
0answers
43 views

Rust based Sudoku solver using backtracking

I've just started learning rust and have written a basic sudoku solver, however it seems to run much slower than I expected. So I'm looking for any possible performance improvements as well as any ...
4
votes
1answer
3k views

Optimizing this maze-solver

I've written C# code for solving a maze problem. It works, but I want to optimize it so that it could give me all paths. To solve the maze, I walk on the zeros and assumed that the final is reaching ...
1
vote
1answer
276 views

A* Implementation results in exponential speed loss

I've created a functional A* implementation in C#/XNA for a game I'm working on. However, I am using rather large paths, and of course, the larger the paths are, the longer it takes to trace them. ...

1
2 3 4 5
167