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
2
votes
0answers
71 views

Advent of Code 2021, Day 3 in Haskell

This is a working solution to today's Advent of Code puzzle, written in Haskell. However, I feel like this solution is not optimal. ...
0
votes
0answers
24 views

Improving multiple row creation query in JavaScript

I'm trying to create multiple rows in my db with an array. This array has multiple objects of products chosen by the client. ...
4
votes
1answer
51 views

Find the mean magnitude of values inside unit circle

I'm fairly new to Python and am exploring how to fix functions and make code 'more effective and readable'. As a first step, I would want to try to make shorter snippets of code here - for example by ...
0
votes
0answers
56 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: ...
0
votes
1answer
45 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
1answer
69 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
242 views

Remove matching lines from all files

I have written a Python3 program that looks for matching strings and removes them from files. ...
0
votes
0answers
17 views
-1
votes
1answer
37 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: ...
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. ...
4
votes
3answers
129 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 ...
2
votes
2answers
67 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 ...
6
votes
3answers
235 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 ...
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
0answers
18 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: ...
0
votes
0answers
7 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
51 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 ...
2
votes
2answers
153 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. ...
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 ...
1
vote
1answer
72 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 ...
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: ...
2
votes
0answers
72 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 ...
1
vote
1answer
64 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 ...
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 ...
2
votes
1answer
86 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): ...
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
17 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 ...
0
votes
0answers
63 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: ...
0
votes
1answer
82 views

How to speed up the search for matching values in a second data frame in a line-by-line iteration over a first data frame?

I have a survey response dataframe for which each survey has a code: df ...
3
votes
1answer
92 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 ...
3
votes
4answers
128 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 ...
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. ...
5
votes
1answer
62 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 ...
0
votes
0answers
31 views

React filter-and-search algorithm

Currently working on a website with the following sorting function, but it's slow and reloads several times when I search for someone; how can I improve its performance? Or, more importantly, which ...
0
votes
0answers
22 views

Clarity and optimization of kmeans algorithms

I have written this k-means algorithm without using any class structure. The audience of my code are students who are pretty new to Python. Is it possible to review the code so that it is more ...
6
votes
2answers
528 views

Find all possible ways a rook can move, C++ version

This inspired by this C# question The basics is to calculate the total number of paths that a rook can take without revisiting a square to move to a diagonally opposite position. I tried to throw ...
5
votes
4answers
350 views

Fastest function to find cumulative largest perfect squares of a single number?

I'm attempting to write an algorithm that will find the largest perfect squares of a given integer, subtracting their values from the total each time, as fast as possible. It's somewhat hard to ...
7
votes
1answer
332 views

Find all possible ways a rook can move to a diagonally opposite corner without going back to an already visited square

This question seems similar to this one: Find number of unique paths to reach opposite grid corner but is entirely not. For moving from upper-left corner to lower-right corner we are not restricted to ...
3
votes
1answer
99 views

Web scraping international trade data

I'm trying to scrape arrival data from this website. My script takes extremely long time to scrape the data. Is there any way I can speed up the scraping process? Here's my script: ...
1
vote
2answers
40 views

RE: Find maximum value of recursively-defined "fusc" function

Continued from the previous post - a brute-force approach to calculating all the vectors from 0 to n. I've come up with yet another solution, after I've realized that the vector takes up too much ...
3
votes
0answers
61 views

Cryptomarket data visualization

For a hobby project I want to visualize the current crypto market in bubbles. The idea is to clone cryptobubbles.net. I've already made a prototype at the moment, but the frames are on the low side. ...
0
votes
0answers
40 views

Swap MIN, MAX object in a list

I have a List of Car with 2 props are String and Integer like this: (A,6) (B,2) (C,9) (D,17) (E,8) (F,17) (G,2) and the result look like this: (A,6) (D,17) (C,9) (B,2) (E,8) (G,2) (F,17) Purpose: Swap ...
0
votes
1answer
78 views

Python 3 weighted random choice function memoized version

I have written a function that randomly picks one element from a set with different probabilities for each element, anyway it takes a dictionary as argument, the keys of the dictionary are the choices ...
1
vote
0answers
47 views

Estimating risk differences for marginal models

I need to estimate risk differences for marginal models. I have worked on the Probratio function to create an equivalent function for RDs that works. Please provide feedback on accuracy or comments to ...
0
votes
1answer
65 views

PHP game - changing color of cells in a blue and white grid => updating groups of white cells that touch each other

My game is a grid in which you have to change cells color by clicking on them. When I generate a grid I have to know all the possible combinations of blue and white cells my game allows, to know the ...
2
votes
2answers
66 views

Comparing Multiple Columns to Remove Duplicates

This code compares data from two spreadsheets generated from our clinic's software. The goal is to eliminate all the rows from the PaymentsSheet (our most recent ...
4
votes
1answer
95 views

Code to scan filesystem, store every path into sqlite and update only when something has changed

I have made a program that does what the title explains. It also hashes the file to check for changes. I will be doing this for a project to keep track of files that has been changed when doing ...
1
vote
1answer
74 views

Find and replace all substrings in a string

Given a list of strings paragraphs and words. Check each paragraphs's item for containing <...

1
2 3 4 5
167