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

Training a Reinforcement Learning algorithm

Problem: I'm trying to reduce the computation time and optimize specific functions of a Reinforcement Learning algorithm in the training phase and observed that one block of code takes too much ...
Student's user avatar
1 vote
0 answers
110 views

Making Robert Tarjan's offline LCA algorithm run (much) faster (Java)

I have produced this GitHub repository that compares the performance of: Robert Tarjan's off-line lowest common ancestors algorithm, An improvement of the above algorithm. Typical demo program ...
coderodde's user avatar
  • 27k
4 votes
5 answers
731 views

Sort a vector containing only three distinct values

I have a program that sorts the vector containing only 0,1,2 in the sequential order so the input array of [0,2,1,2,1] would generate an output ...
xyf's user avatar
  • 508
1 vote
0 answers
17 views

Updating the log-density of a multivariate probit latent class model

I am new to Rcpp and am looking to make the following code as fast as possible. Any tips would be greatly appreciated. It is running a lot slower than I would like. I have tried vectorising as much as ...
E_1996's user avatar
  • 11
1 vote
1 answer
167 views

to capture packets with options like -i interface, -o open file, etc using pyshark and python

review my code if possible. I am making network packet capture using pyshark and python. if possible give me some feedback about the code and help to make it better. ...
user20828450's user avatar
2 votes
1 answer
110 views

Powershell file parsing

I am using Powershell 7. We have the following PowerShell script that will parse some very large file. I no longer want to use 'Get-Content' as this is to slow. The script below works, but it takes a ...
Cell-o's user avatar
  • 295
2 votes
2 answers
173 views

Quick Sort Program

Quick sort is a sorting algorithm in which we select any random element as pivot from the array and we do the partition of the array around that pivot. Basically we place all the elements smaller than ...
Strange Alchemist's user avatar
1 vote
2 answers
107 views

Logistic regression using gradient descent

My code seems to work fine, but I'm interested in how I can make it faster. I really just want to reduce any wasteful computation (for instance ...
hillard28's user avatar
1 vote
1 answer
76 views

Group uncorrelated variables into subsets using correlation matrix

I am trying to group uncorrelated variables into subsets. So, using the correlation matrix, I check each variable to see the correlation. If correlation is more then a threshold I will create a new ...
Nmgh's user avatar
  • 13
1 vote
1 answer
142 views

Text to image steganography

This simple implementation hides text secrets (S) in images by manipulating the least significant bits (lsb) on Pixels. How it works When encrypting I take a three pixel "chunk" for each ...
チーズパン's user avatar
3 votes
1 answer
133 views

Solve an option pricing PDE in Python - Part 1 [closed]

The Github repository NM-Heston solves call option prices under the Heston 2-factor model using ADI splitting schemes. I am adapting the code to price options under the 3-factor Heston-Hull-White ...
Ruan's user avatar
  • 101
1 vote
1 answer
70 views

calculating the percentage of distribution of ids per Loc for each country

Which of the two queries is theoretically better and why? I would like to understand why query 2 takes longer although there is no relevant information in the Execution Plan. I'm querying a Presto ...
Pin_Eipol's user avatar
7 votes
4 answers
1k views

Calculate average values for each day of the week for each Meter

I have a program with these two methods. One method to import a set of data from a CSV within the given time period and store them in a dictionary. Here the data in CSV file is stored in following ...
HARINDA VITHANA's user avatar
0 votes
0 answers
142 views

Program to generate a tree of permutations

There is a computation I'm doing with permutations (permutations of varying length of an entire interval [1,N] for some N) in python that I feel could be faster. ...
Matt Samuel's user avatar
3 votes
1 answer
238 views

Python script copying specific table data from multiple docx files into an XLS file

The code copies the second column from the right of all the docx files' tables from the folder where the py file is saved, and does some editing on the content in specific cases. The problem that it ...
Domi Szécskai's user avatar
5 votes
1 answer
108 views

Prune unreachable sections of a directed graph

I have a graph represented with an Adjacency set similar to: ...
Tom McLean's user avatar
9 votes
3 answers
2k views

Euler's brick generator in C++

I stumbled upon this unsolved problem of math named Euler's brick. I wrote a program in C++ to generate solutions for Euler's brick problem. It searches from ...
RandomCoder59's user avatar
3 votes
0 answers
61 views

Gather product information from the Apotheek Dedeyne web site

I'm learning Python Scrapy, and I'm scraping product information from the following website: https://apotheekdedeyne.be/ This project is for personal learning & ...
Seraph776's user avatar
  • 191
4 votes
3 answers
137 views

Simple photomosaic generator

I wrote an implementation of Robert Heaton's Programming Exercise for Advanced Beginners #4 (photomosaics) in C99 using the MagickCore library. The full code is as follows: ...
Wilson's user avatar
  • 43
4 votes
2 answers
858 views

Brute-force Integer Diophantine equations solver

I want to improve the performance of my equation solver So I have an expression:- 42a + 75b - 30c + 80d + 25e + 50f, let's call it ...
Noby's user avatar
  • 115
1 vote
1 answer
121 views

Rust state-machine lexer

I tried implementing a lexer in rust that peeks ahead at the next character and makes a decision based on that. However, i am told that this is bad practice, and instead i should be using finite-state-...
xxxxxxxxxx's user avatar
3 votes
3 answers
411 views

VBA Very Slow Performance using objects with scripting dictionary

I have a simple code that loops through a text file to fix a few things in it and I use mostly dictionaries to find and handle the adjustment. However, with larger files (about 30K lines) it seems to ...
KE_1234's user avatar
  • 31
5 votes
2 answers
959 views

Optimizing Python BFS Code

...
FailingCoder's user avatar
2 votes
1 answer
147 views

CUDA-Kernel for a Dense-Sparse matrix multiplication

i have been working on a very big project for some time. Within this project, I wrote my own CUDA-kernels to do various operations. One of them is to perform a sparse affine transformation to a list ...
Finn Eggers's user avatar
5 votes
1 answer
1k views

String literals concatenation with support for dynamic strings

I have implemented a function to concatenate string literals at compile time. Basic requirements: Very simple API. Can be used as a one-liner. Must accept variadic string literals. Highly optimized ...
Sergey Kolesnik's user avatar
2 votes
1 answer
141 views

Dijkstra's Algorithm + an additional cost to start at each node

I am trying to solve the 2009 Canadian Computing Competition Senior #4. The question gives you a map (graph) of different cities, and the cost of transporting something between each city. There are ...
Justin Cheng's user avatar
0 votes
1 answer
126 views

supporting unicode in rust lexer

I am working on a lexer in rust. It has been through many different iterations, going from iterating over a Vec<char> to ...
xxxxxxxxxx's user avatar
1 vote
2 answers
123 views

OpenGL: Rendering the same sprite several times

I've been trying to make refactor really simple 2d sprite engine in OpenGL. As a start, I'm trying to use instanced rendering to render several copies of the same sprite in a square formation across ...
Ruglord's user avatar
  • 13
0 votes
0 answers
51 views

3D renderer with polygons

I'm currently working a 3d engine in python but my biggest issue is speed. while doing some profiling I found that texturedQuadronFunc.drawQuad() takes about 5s to ...
Roberto E. Torres's user avatar
0 votes
1 answer
72 views

Parsing shortcodes out of a string

I wrote this shortcode parsing and it runs in \$O(N^2)\$. Is there a way to better optimize this? ...
ericraio's user avatar
  • 151
-2 votes
2 answers
73 views

Is there a more elegant solution to store and process different types using templates? [closed]

I'm trying to create some system for profiling and I need to track different data types (double, float int). I have a container that can hold some base type, and then perform actions on the concrete ...
kbz's user avatar
  • 99
2 votes
2 answers
76 views

Slow Bioinformatics algorithm - Clump finding algorithm in Haskell

I'm working on the famous clump finding problem to learn Haskell. Part of the problem involve breaking nucleotide sequences, called kmers, into subsequences as follows: ...
plaffont's user avatar
4 votes
2 answers
246 views

Multiplayer queue optimisation

I currently have code that is working but I think it can be optimised. The code waits until a player joins and adds the player to a BlockingQueue if there is not already a Player waiting then it ...
Lee's user avatar
  • 43
3 votes
1 answer
425 views

Prime factorization algorithm by using the multiprocessing module of Python

I may introduce a Python code of prime factorization which is from my personal project that I'm working on. ...
MYUN's user avatar
  • 39
4 votes
1 answer
306 views

lexer for programming languages in rust

I'm relatively new to rust, so you don't need to go easy on the criticism. right now, this lexes 1MB of text (well, trims a 1MB-long word) in 30ms. is there any way I can make this faster? cursor.rs: <...
xxxxxxxxxx's user avatar
2 votes
1 answer
102 views

Built a Vector2 class with easing functions, that can be unpacked

...
DracoDaine's user avatar
6 votes
2 answers
1k views

Read a large CSV order book

I am trying to read entries of my CSV file into an entries vector whose data type is object OrderBookEntry, which is an object that stores the tokenized variables ...
Beginner_coder's user avatar
3 votes
0 answers
103 views

E-car-sharing problem with charging between the bookings

I am writing code that, at some later point, will be part of an academic multi-agent simulation of the learning process of car-sharing users and grid stability. This code deals with finding the price ...
Andreas Schuldei's user avatar
0 votes
0 answers
88 views

Is there a way to vectorize the following string concatenation technique to enhance overall performance?

I have a list of accounts, accounts that's passed to a function query_builder which combines a set of variables and produces a ...
Zach's user avatar
  • 11
7 votes
1 answer
223 views

Chess position representation with FEN parser

I'm developing a UCI chess engine and as part of my engine I need a position representation that stores the position of every piece on the board and all the information about the game, like castling ...
Aiya's user avatar
  • 108
0 votes
1 answer
149 views

Efficient way to read files python - 10 folders with 100k txt files in each one

i am looking for an efficient way to read and append texts of .txt files to a dataframe. I currently have 10 folders with 100k documents each. What i specifically need to do is: getting the names of ...
Piergiorgio Di Pasquale's user avatar
1 vote
1 answer
172 views

C++ Resource Manager base for game application [closed]

I'm writing a Resource Manager for my small but scalable future project. The main target of this is to get best speed of access, be flexible and avoid memory leaks. Enumerations ...
user3000633's user avatar
1 vote
1 answer
49 views

Create subset of points cloud from a predefined ones following two conditions

I'm trying to optimize algorithm 1 in my following code. First double loop, I calculate points beforehand which will run only once. Then I have the first version of ...
Ja_cpp's user avatar
  • 341
2 votes
1 answer
74 views

Inserting Rows after Contiguous Set of Integers - Excel VBA

I have a repetitive data reduction where I have a list of ID's that I want to find in a longer list. I have a method, but it is slower than I'd like. How can can I speed this up? The process: After ...
Brandon Murray's user avatar
3 votes
3 answers
288 views

Most effective search algorithm for guessing list of strings via function returning bool if substring is in list using Python

I trying to figure out the most effective way to accomplish this task: A function, check(), contains a list of strings. Calling the function with a string as ...
n0k's user avatar
  • 31
0 votes
1 answer
102 views

Effective encoding-decoding chain determination (time optimization)

Could you please help with speeding-up this code? Input: UTF-8 text (encoded 1-3 times from known pool of encodings). Every time was encoded and decoded by random encoding from pool. Original was koi8-...
Kir S's user avatar
  • 1
3 votes
1 answer
312 views

Yet another sparse set implementation

I got inspired by this blog post and implemented a fixed-size sparse set, removing the need for vectors, because the sparse set's size equals at least ...
Tab's user avatar
  • 33
0 votes
1 answer
280 views

lemmatize very long texts in python

i really need to optimize this piece of code for my master thesis. it take up to 20 seconds to lemmatize documents with >6000 words. the problem is that i have to lemmatize more than 200.000 ...
Piergiorgio Di Pasquale's user avatar
2 votes
2 answers
118 views

Finding a function from a name within a string

The code is designed to see if the first alphabetic characters in the *str argument refers to a known function, as part of a calculator app, and sets ...
user16217248's user avatar
1 vote
1 answer
96 views

Further optimizing the ISING model

I've implemented the 2D ISING model in Python, using NumPy and Numba's JIT: ...
Amirhossein Rezaei's user avatar

1
3 4
5
6 7
174