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
1answer
17 views

Find circles for `f(z, c) = z ^ 2 + c` of length 6 in rational numbers

I've found pretty simple problem on Numberphiles channel: suppose we have a recursive function $$ \begin{equation} \begin{split} f_0 &= Z ^ 2+ C \\ f_i &= f_{i-1}^2 + C \; | \; i = 1 \dots \...
6
votes
1answer
250 views

Python: determine whether one string can be obtained by changing one character in the middle of another string

This script solves a simple problem: Input two strings differ one character or zero characters in length, return true if the following conditions are met: 1, They must start with same character and ...
1
vote
1answer
38 views

Open, writing to, and closing a configuration file, and error checking the process in C

All this does is safely and reliably opens, writes to, and closes the file. Yet there are so many gotos and the code is quite verbose. I am not even sure that all ...
3
votes
2answers
44 views

How to implement a 2D Cellular Automaton in JavaScript?

So far I have this: ...
1
vote
0answers
8 views

How to avoid retracing in tensorflow when predicting scores for inputs with different sizes

I use the following code in order to assess the quality of an audio, which is based on this original-project: MOSNet. I call compute_mosnet_score() in a loop with a ...
4
votes
1answer
45 views

Python PyQt6 populate QTreeWidget with a list of named tuples

This is a Python 3.9 script that pulls data from a MySQL database and converts it to a list of named tuples and then passing it to PyQt6.QTreeWidget. It has to be a ...
3
votes
1answer
44 views

Python script that makes ngrams

This is a Python script that generates ngrams using a set of rules of what letters can follow a letter stored in a dictionary. The output is then preliminarily processed using another script, then it ...
1
vote
1answer
81 views

C++ vector bubble sort in my edition

I made a small adaptive function that sorts vector: ...
2
votes
2answers
59 views

Updated version of my first neural network in c++

I got lot of suggestions for optimizing my neural network last post I made, now I wanted to post updated version of it were I got rid of most of performance eaters, now I would really appriciate ...
2
votes
2answers
82 views

return the sum of the squares that is equal to n²

I'm struggling to solve this Kata. My code works but I can't pass because it's timing out. I have googled it and even tried other people's code but still doesn't pass. Any suggestion on how can I make ...
1
vote
0answers
42 views

Small language, compiles to register VM bytecode

I am trying to implement a small programming language, in Nim, as a way of improving my (close to non-existent) programming skills. The programming language is intended to have IF-GOTO, variables, and ...
1
vote
0answers
23 views

More Efficent Code for Announcment Command in Discord.js

I am creating a command in my discord bot to send an announcement to every server it is in, and this is the only way i could think of doing it, but i know there is a more efficient way of doing it. ...
0
votes
0answers
16 views

Two dimensional bicubic interpolation implementation for dlarray in Matlab

This is a follow-up question for Two dimensional bicubic interpolation implementation in Matlab. While I am working on neural network designing, I want to compare the effects between using padding and ...
1
vote
0answers
14 views

Inserting captions under photographs in word based on entries in excel spreadsheet

I have a macro written in word for transferring captions written in excel to a corresponding photograph in a word document. At the moment it runs however I am finding that it slows down over time the ...
-1
votes
1answer
56 views

Passing a partial application as an argument of an other function with no overhead [closed]

I am trying to find a way to pass a partial application as an argument of an other application with no overhead. I think I have find a way to do it (which might be dirty). The templated structure &...
1
vote
1answer
34 views

tokenize char array with PolarSSL library

I'm trying to perform a decryption operation using RSA. I'm using the PolarSSl library. I have a char array key[] that contains RSA private key like the following, <...
3
votes
1answer
62 views

Java i/o speed less than python i/o while printing an array

Motivation: I was solving an array based i/o problem and encountered Time Limit Errors, it was later found that the code for java ran roughly 10x slower than the ...
2
votes
1answer
45 views

Tiny attempt at a register machine in Nim

I am attempting to learn the Nim language by making a small and simplistic register machine. It is intended to interpret some basic instructions. The entire parsing lexing process consists of ...
1
vote
0answers
46 views

Computing the angle between two vectors (vectorized) for small angles and with few copies

I am implementing a function that computes the angle between two vectors when given two n-dimensional arrays and an axis along which to operate. I want to do this with as few copies as possible, and ...
3
votes
0answers
44 views

Speed Up API Requests & Overall Python Code

I'm not asking for help solving a problem but rather asking for help for possible ways to improve the speed of my program. Essentially what this does is: Tracks market data by pulling the data from ...
3
votes
3answers
74 views

Image Processing Sobel Edge Detection in C

This is a follow-up question for Image Processing Median Filter in C. Under the same tiny bmp image read / write framework, a sobel edge detection function has been performed. The experimental ...
4
votes
2answers
106 views

Merge two pulses if they match

The function processFus() takes : Two lists of pulses (200 000 in each), as an input Two lists of pulse, empty, pulseValid and invalid. The function must fill them ...
0
votes
1answer
20 views

Rotation Management Application

My code works just fine but it seems like I have too many variables which could confuse people from what the code does. Any ideas? Or does this look fine. Feel free to add any other tips to make my ...
5
votes
0answers
97 views

Multithreaded pathfinding in Unity C#

I've tried to implement multithreaded pathfinding in an attempt to increase performance, but if anything, performance seems to actually decrease when I enable multithreading. Is there anything I ...
2
votes
1answer
47 views

Find the most similar pair of rows from a table

I have a list of n cities and hourly weather prediction for each one of them for h hours. I'm writing a script to find a pair of ...
3
votes
2answers
61 views

Python 3 approximate pi using 9 algorithms

Note: this script requires gmpy2, if you are using Python 3.9.5 x64 on Windows 10 21H1 like me, then you need to download the pre-built ...
2
votes
1answer
39 views

Optimizing telegram bot

I was working on one telgram bot, and when finally i made everything i discovered that it is extremely slow. def s takes 5-7 seconds to get result and send it to user, i tried to optimise it with ...
0
votes
1answer
29 views

Bash script (to be used as a login MOTD message) that displays status of docker-compose projects, and individual docker containers

This is for a cheap VPS I use for personal projects. I like having a message of the day displaying system info on login; I wanted to add the status of my docker containers to it, to see if all are ...
8
votes
7answers
1k views

Remove all unwanted characters from a string buffer, in-place

The following code was written with the intent to be as efficient as possible, where efficiency includes speed of execution, memory usage, and lines of code, all in support of the primary design ...
18
votes
2answers
2k views

Chess engine for C++

Basic Description What is the program for? This is just a hobby project for me to improve at coding, not a serious one. What does the program do? It can take a chess position (not including variations ...
3
votes
1answer
89 views

Python Place +,-, nothing between 1, 2, …, 9 (in this order) whose sum is 100

So this is a programming challenge I saw: Write a program that outputs all possibilities to put + or - or nothing between the numbers 1,2,…,9 (in this order) such that the result is 100. For example ...
0
votes
1answer
53 views

Enter the randomly displayed letter console game

The below code segments compose a simple console game where the user is prompted to enter a randomly generated letter displayed in the console. It also saves and loads user data through a .txt file. ...
0
votes
1answer
43 views

R code optimization

I have about 977 obs in top500Stocks which contains name of 977 stocks. ...
3
votes
2answers
64 views

CLI ASCII Maze Generator / Python 3.9

I made a maze generator in python that outputs in CLI. With mazes that are extremely big, it can take a while to output. I want to know if there is any way to increase the efficiency of this code. ...
5
votes
1answer
335 views

A Prime-Generating Algorithm and Python Script

I was wondering if it would be possible to optimise my python script? It is designed to quickly generate and print all the prime numbers under some inputted number. It is fairly fast currently, and I ...
2
votes
2answers
57 views

Find the 10001st prime number

Project Euler 7: What is the 10 001st prime number? I currently have this code: ...
2
votes
1answer
57 views

Brute Force Password Program / Python 3.9

I've been making a brute force program for fun. This program tries to guess a password using brute force. I've tried many things to help increase the efficiency. Here it is: (Sorry for the lack of ...
-1
votes
1answer
33 views

Displaying custom fields with values

How can I optimize and shorten this code that I am using to display Woocommerce custom fields? ...
0
votes
0answers
14 views

Archiving / Moving Data from one database to another

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 ...
-1
votes
0answers
49 views

sum of multiple piecewise functions python

suppose I have a few lists ...
2
votes
1answer
66 views

Alpha beta pruning with memorization (transposition tables) and bitboards (5x5 cumulative tic-tac-toe)

This is my first time trying solve a game using these techniques. I've looked at pseudocode of alpha-beta pruning with transposition tables and rewritten it in c++. ...
2
votes
1answer
60 views

How to increase the success rate of my Tic Tac Toe AI that uses the Minimax Algorithm?

this is my first post here! I am working on a Tic Tac Toe AI in Python that uses the Minimax Algorithm to beat either a computer or a normal player. As of now, It has approximately 70% chance of ...
2
votes
1answer
39 views

basic paging function, is there logical problems with the JavaScript part?

Basic paging function, is there logical problems with the JavaScript part? very basic paging function. I want to know if there are some problems in the logic of the code. I feel the JS code is a bit ...
0
votes
1answer
55 views

Optimizing location updates when adding a new object

I'm trying to keep a bunch of Objects called Machine in their proper order. I was wondering if it'd be possible to further optimize the function ...
4
votes
2answers
65 views

For each of the visitors, find if they were present within a time period: code is running slow

I'm working with a pandas dataframe which describes the start and end time of visits. A toy example of the data could be as follows: ...
3
votes
1answer
20 views

Python script that converts Windows Registry Scripts (.reg) into PowerShell scripts (.ps1)

Well this a re-implementation of a PowerShell script that I wrote which does exactly the same thing, and I have ported it into Python. After a quick Google search I found that there is only one other ...
3
votes
0answers
38 views

Extracting Korean text for sentiment analysis

It is quite long so I'm not sure I can ask you to review my code. But I have no choice indeed. What I'm doing is analyzing the Korean language. To do this, first I collect data and loaded the data via ...
-1
votes
0answers
50 views

Would like advice on SOLID principles in my Unity C# script

I am working to understand SOLID, and want to know how my Unity C# script could be better formatted to align with the principles. I will provide the script and then an explanation: ...
4
votes
1answer
78 views

Dataframe transformation to numpy ndarray takes ages to complete

I would like to transform my dataframe into an array of fixed-sized chunks from each unique segment. Specifically, I would like to transform the ...
0
votes
0answers
41 views

How do I make my html object-to-table array script run faster? (Pandas)

I have a data frame that has several columns, one of which contains html objects (containing tables). I want a column of table arrays. My problem is that this piece of code takes a long time to run. ...

1
2 3 4 5
162