Skip to main content

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
3 votes
1 answer
94 views

Multithread execution times are slow on Ubuntu and fast on Windows

I'm working on a project accelerating the execution of a Genetic Algorithm both on multiple cores and on a GPU. The algorithm is specifically suited for the solution of the Traveling Salesman Problem ...
Pietro Pianigiani's user avatar
2 votes
0 answers
64 views

Optimizing even more a C++ matrix class with expression templates using variadic templates

I looked at Bowie Owens' cppcon 2019 talk (the slides can be found here) where he shows how to implement a tridiagonal matrix classes using expression templates but without resorting to the CRTP. (It ...
11house's user avatar
  • 21
5 votes
1 answer
121 views

Creating random music covers using Conways Game of Life algorithm

(A sample cover art follows.) I'm currently working on replacing all the covers of my music files to have a unified theme, and I've started this project in Java to refresh my knowledge after a gap of ...
Zipity's user avatar
  • 51
3 votes
1 answer
79 views

Scraping website with Python and Selenium to collect data from dynamic website

Summary: The code scrapes the website and collects the data to store it in CSV. It also downloads selected information that is available for download in PDF format. The details and the entire code are ...
sangharsh's user avatar
  • 279
7 votes
3 answers
2k views

Simple TCP port scanner

I’ve done port scanner program. It works well and accurate, but there is a problem. It’s SUPER slow. That’s how it looks: ...
Eudziro's user avatar
  • 81
5 votes
1 answer
337 views

Leetcode: Largest Number

I was trying out leetcode's Largest Number. As per the challenge's description: Given a list of non-negative integers nums, arrange them such that they form the largest number and return it. Since ...
ccot's user avatar
  • 341
0 votes
0 answers
47 views

Unity Gesture Recognition Code in C#

I'm new to C# programming and have been working on a Unity project that incorporates gesture recognition using the PDollarGestureRecognizer library and Unity XR Hands package. My application is ...
user17410204's user avatar
7 votes
1 answer
273 views

Multithreading message queue system

For an application I'm developing, I need an system which allows a thread to submit messages to another thread. For this purpose I designed a message queue system with the following features. Any ...
Sam Coutteau's user avatar
4 votes
2 answers
244 views

This is a simple stopwatch cli application with a few options

My goal of this when I started writing it was simply that it be able to record thousandths of a second in a very performant and accurate way. I'm not sure I have achieved the performance aspect of ...
lull's user avatar
  • 43
3 votes
1 answer
115 views

Sorting the divisors of a given number

I am trying to sort all the divisors of a given number in the most efficient way. Below is my code for sorting the divisors: ...
Arjun Kumar's user avatar
2 votes
1 answer
57 views

Looking for feedback on a flavour of Radix tree I wrote. This is version 2 of the class original posted on this forum

My project explores some ideas i've had regarding alternate data structures to the unorderd_map and map, and aiming the exploration to key sets with a non uniform distribution and key sets with common ...
ver2's user avatar
  • 61
4 votes
4 answers
1k views

Creating an O(n) algorithm for an array of integers

To avoid plagiarism in my university, I am going to modify the problem. Henry likes to jump from building to building. The heights of each building are given as a list of H numbers. We also number ...
Lesserrafim's user avatar
4 votes
2 answers
304 views

Simple version of NEAT

I have wrote my own simple version of NEAT and want to improve the code for mainly performance (training and runtime of a generation). This simple version of NEAT aims to perform somewhere near as ...
coder's user avatar
  • 121
1 vote
0 answers
47 views

React based Quiz Website

I have recently worked on a quiz application using the MERN stack. The application incorporates various features such as user authentication, quiz creation, scoring functionalities, and data ...
Ultimate's user avatar
  • 143
0 votes
0 answers
35 views

Add a new sheet for all files in folder, pull data from multiple reports for each one, save PDF/xlsx summary

I'd appreciate any help people can offer to make this process more efficient and less goofy. I've created a process to loop through a folder of approximately 100 files, add a new sheet with a base ...
Kris's user avatar
  • 1
4 votes
0 answers
72 views

Google App Script to take form responses submitted by teachers on their students and produce formatted PDF student reports

I'm not a programmer but, with help, I managed to make a Google Apps Script which takes reports, submitted by teachers on their students, to the Form Responses Sheet, and then selects all responses ...
StreetSavvypub's user avatar
2 votes
1 answer
51 views

Benchmarking putchar_many vs puts Performance for the Same Byte

Whilst writing an interpreter for Brainfuck, I had collapsed sequences of .......... to a single instruction OP_PUT (10) (Note ...
Harith's user avatar
  • 9,442
4 votes
1 answer
132 views

Longest spell to cast from pages of spellbook follow-up

This question is from the PCTC 2022 R2 Past Paper and is a follow-up on my previous question. Previous question I have implemented several solutions suggested, such as creating an array with pages ...
helielicopter123's user avatar
5 votes
0 answers
228 views

tbf - An Optimizing Brainfuck Interpreter and Transpiler in C

Language: The Brainfuck programming language consists of eight commands: ...
Harith's user avatar
  • 9,442
4 votes
1 answer
190 views

Looking for feedback on a flavour of Radix tree I wrote. The idea is speed on find() time if keys share common prefixes and are known ahead of time

My project explores some ideas i've had regarding alternate data structures to the unorderd_map and map, and aiming the exploration to key sets with a non uniform distribution and key sets with common ...
ver2's user avatar
  • 61
1 vote
2 answers
123 views

Miller-Rabin prime test

I have an implementation of the Miller-Rabin prime test, coded in Python 3. I want to use that as a comparison to a prime test which I coded myself. Unfortunately I have no idea how "fast" ...
Lereu's user avatar
  • 141
8 votes
2 answers
267 views

Filling a buffer with a repeating pattern of N bytes

My program will clear the screen to a 24bit RGB color; in other words, it will fill a buffer with a repeating pattern of 3 bytes. So I wrote patternMemcpy to perform this operation efficiently*. It ...
Vortex 2728182818's user avatar
9 votes
4 answers
1k views

Reverse Engineering Data Files (Binary Visualization)

Binary Visualization based on Christopher Domas talk: youtube link and this Russian programmer where I discovered this talk: youtube link. Algorithm: Scan the pairs of bytes of a file with a sliding ...
Harith's user avatar
  • 9,442
2 votes
1 answer
187 views

Autocorrelation of a vector series

Related: Autocorrelation of a vector series (2) The given C# source code computed autocorrelation of a vector series. The listing gives accurate results, but is horribly slow. How can I optimize it to ...
user366312's user avatar
4 votes
2 answers
496 views

Leetcode: Steps to Make Array Non-decreasing

I was trying out leetcode's Steps to Make Array Non-decreasing As per the challenge's description: You are given a 0-indexed integer array nums. In one step, remove all elements nums[i] where nums[i ...
ccot's user avatar
  • 341
4 votes
1 answer
98 views

What could be the more optimised way to get all unique subarray which equals to a target

I am trying to solve Combination Sum II on LeetCode. I was able to derive a recursive solution for the problem but it is not optimised as it only beats 10% of the solutions. Combination Sum II Given ...
Dr._Duck's user avatar
6 votes
1 answer
902 views

Show how close a user is to being unsung

So this morning, I decided to create a SEDE query that answers the age-old question "How close am I to being Unsung?" because I recently polished up my first SEDE query and I realized that I ...
CrSb0001's user avatar
  • 279
4 votes
3 answers
587 views

Leetcode 3sum problem solution

The problem is: Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] where ...
Oliver's user avatar
  • 41
1 vote
2 answers
125 views

Optimizing an algebraic assignment puzzle

I am going to do a math competition which allows writing programs to solve problems. The code attempts to solve problem 25 from the Purple Comet Spring 2004 Mathematics Meet: In the addition problem <...
Lucien Jaccon's user avatar
2 votes
1 answer
246 views

MySQL interval search query suggestions

My database structure is: ...
friday-json's user avatar
9 votes
4 answers
2k views

Leetcode : First Missing Positive

I was trying out leetcode's first missing positive. As per the challenge's description: Given an unsorted integer array nums, return the smallest missing positive integer. You must implement an ...
ccot's user avatar
  • 341
0 votes
0 answers
99 views

1d profile cutting optimization

I wanted to make a VBA that creates self-renewing combinations and I actually did it, but Excel was crashing when the combinations increased, unfortunately Excel does not work in multi-item lists. ...
ömür tokman's user avatar
0 votes
0 answers
82 views

Check all files in two folders with partial match in name and update one of the folders with the newest from both

Here is the code I am using it works fine; however, it obviously takes forever when there are a lot of files to check. exact shell is cmd.exe. I am really just looking to make it more efficient. Here ...
James Davis's user avatar
3 votes
1 answer
107 views

Read a line from a stream

Since the standard fgets() does not suffice for my use cases, as it doesn't automatically enlarge the target buffer if needed, and ...
Harith's user avatar
  • 9,442
5 votes
4 answers
1k views

Optimized Python Solution for Determining if an Array Contains All Possibilities

Problem: You have been tasked with writing a method named is_all_possibilities (or IsAllPossibilities, as per your preference) ...
user avatar
7 votes
1 answer
406 views

Scientific Calculator

I finished this code a few minutes ago. It started off as an explanation of a basic calculator in C to a friend. Then we decided to take it further and I made this. Please tell me where I can make ...
ThePowerHex_YT's user avatar
6 votes
2 answers
695 views

Encrypter and decrypter project

I am here to ask for criticism, as for my first week of Python I feel like I have improved a lot. I recreated the first program I made within my first hour with a tutorial, the one I made now is based ...
ShiroAboveAll's user avatar
1 vote
0 answers
90 views

`summarize()` the Power Set of Grouping Variables in R

Background On a whim, I wrote a function called summarize_pow(). It performs dplyr::summarize() on ...
Greg's user avatar
  • 403
4 votes
2 answers
259 views

Is it possible to make this Minecraft Bedrock addon script less resource intensive, so that it no longer triggers performance warnings?

Following the notice that block events will be removed in a future update, I have been implementing custom block mechanics (such as crop growth and groundcover spreading) using server-side scripts ...
Quack E. Duck's user avatar
1 vote
0 answers
37 views

PHP WordPress Code - Pricelist Template - refactored

I've been working on a refactoring my old WordPress pricing page template and would appreciate feedback on the code structure, organization, and any potential improvements. The template is used to ...
KermitTheFrog's user avatar
3 votes
2 answers
100 views

Making an "analogue display" by drawing boxes

This is a personal (very amateur) project to teach myself how to use if statements, lists/tuples, loops, etc. It takes an input of one letter and using a pygame-based module ...
Flampzah's user avatar
1 vote
1 answer
54 views

Find all unique file owners through Powershell in an NTFS file system

I'm trying to find all unique file owners in an NTFS file system. Getting the number is fairly straightforward, but my current approac is very inefficient: ...
Tanaka Saito's user avatar
3 votes
1 answer
114 views

Performing tasks on for-loop over thousands of items in Rcpp

I am trying to adapt an R script that I wrote to perform several tasks in a for-loop. The for-loop run over thousands of items, for about 900 times, therefore I would like to optimise my code at the ...
CafféSospeso's user avatar
1 vote
1 answer
59 views

Insert huge data from csv file in .Net framework 4.7.2

I need to insert about 500k - 1 million data lines from a CSV file. The time of getting the reports list and insert to database by using SqlBulkCopy is very good (...
HaNgocHieu's user avatar
0 votes
1 answer
48 views

Efficiency of Apache Beam + BigQuery pipeline

This is my first Apache pipeline. It takes a JSON file and saves the correctly formatted rows in one table, and the misformed rows in another. My biggest worry is the efficiency. I have tested the ...
Yulia V's user avatar
  • 635
4 votes
2 answers
286 views

Count frequency of words and print them in sorted order

Objective: Write a program to count the frequencies of unique words from standard input, then print them out with their frequencies, ordered most frequent first. For example, given this input: ...
Harith's user avatar
  • 9,442
1 vote
1 answer
101 views

"stray" point correction in 2D array

I have a code which does the following: For each value v in a 2D array, look at neighboring positions - how far to look is specified by distThreshold. If the count ...
andrewb's user avatar
  • 113
4 votes
1 answer
115 views

Video transcoding using ffmpeg

I am transcoding video to different quality using ffmpeg using subprocess in Python. I want to make my transcoding faster. I tried multi-threading but it didn't help. Hardware acceleration is not ...
Rai Shahnawaz's user avatar
2 votes
1 answer
50 views

A collection based on a bitset to store a set of unique integers from a given range (rev. 3)

All right, let's do this one last time. This is continuation of this review. I applied most of the proposed changes, making interface of my container very close to that of ...
Piotr Siupa's user avatar
6 votes
1 answer
948 views

Split command in C++20

The Windows OS doesn't feature a Split command and although I do have a Linux partition, I mainly use Windows 11. As such, I implemented the ...
machine_1's user avatar
  • 581