Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.

0
votes
1answer
13 views

Array Partitioning

I have a method in Java that I'm using to partition byte[] arrays into a number of fixed-size sub-arrays. It's not necessary for the last array to be that size, but all preceding ones must be, and the ...
10
votes
4answers
315 views

Processing XYZ data from a large file

I'm new to programming (1.5 years experience at university), and I'm working on my first computer vision related project! My goal is to take a file which might have CSV (comma separated) or txt format ...
5
votes
2answers
41 views

Hex Dump Utility in x86-64 Assembly, under Linux

As a relative newbie to Assembly programming, although I can get my programs to work, I have no idea if they are disastrously constructed or not. I have created a simple Hex Dump Utility, using x86-...
0
votes
0answers
30 views

Generating bingo boards with non-repeating sequences [on hold]

I am trying to write a bingo board generator. There are 40 possible entries, each board has 5 x 5 cells, and I need 25 boards. Each board has 12 winning sequences -- 5 rows (...
2
votes
0answers
47 views

Exporting tables from 30 databases

What my code do: Connecting to 30 DB (consistently) Copying DB file to temp.dat Reading temp.dat Writing read data to file So, it connects 30 times with different databases. This take 6-7 second (...
4
votes
1answer
327 views

Check for pixel spacing between two folder images

Im trying to match the pixel spacing between two folders, here matches has 994 keys and it shows that i may take more than a day to compute this. Is there any way i can speed up this operation. the ...
-3
votes
0answers
40 views

Parallel computing [on hold]

Measuring the effect of Parallelization Using one of the suggested methods in class ( p-threads, OpenMP, C-Sharp or Java Threads) implement an application that adds two integer vectors (A,B) and store ...
3
votes
1answer
56 views

Huffman Coding library implemented in C

I have written a small library for C that implements the Huffman coding algorithm as outlined in David Huffman's paper on Minimum-Redundancy Codes, and a small test program to implement it. The ...
3
votes
3answers
102 views

Express a number as a sum of powers of 2

This is my function: ...
8
votes
2answers
77 views

Python 3 two-sum performance

I just submitted a Python solution to the 'Two Sum' problem on LeetCode. The Problem Given an array of integers, return indices of the two numbers such that they add up to a specific target. ...
-5
votes
0answers
58 views

Readability Vs Efficiency [closed]

Readability Vs Efficiency V1 and V2 are equivalent. V1 is more readable, but V2 saves the call to function_call_2. What should be the ideal choice? V1 ...
4
votes
1answer
100 views

Sieve of Eratosthenes in Python

This is yet another take in Python for the infamous Sieve of Eratosthenes. I am a beginner in Python so any criticism is highly appreciated. ...
2
votes
0answers
27 views

Stored procedure to implement a search filter

I've implemented a stored procedure for a search process SQL Server 2008. I'm not sure if everything I created is correct. Also I'm wondering if this code has any leaks or vulnerability on SQL ...
8
votes
1answer
277 views

Solve 8-tile sliding puzzle

I created a BFS algorithm in order to solve an 8-puzzle, and while it works, it is awfully slow compared to my DFS implementation. My main point of concern is the puzzleExists() function, which ...
3
votes
2answers
78 views

Reading set of large log files line by line and count how many hostnames appear on each line

I have around 300 log files in a directory and each log file contains around 3300000 lines. I need to read through each file line by line and count how many hostnames that appear on each line. I wrote ...
-2
votes
0answers
53 views

Regex engine for use with fast disassembly

How can I speed up the function regexEngine? On my machine, it takes 7 to 10 seconds (depending on the format string) to do 2545 iterations ( linux ssh: https://i....
0
votes
1answer
29 views

Manager that collects and handles multiple tasks that run on events like window.scroll, window.resize etc

I'm working on a website where different things can occur on resize and scroll events. I only want one event handler that comes ...
3
votes
0answers
72 views

Sudoku-lite challenge

You can find the problem here. The example: Column A, B, and C are each 3 and together equal 9: ...
1
vote
1answer
42 views

performance test the code for finding time taken to fill the disk space

I have written this module that takes input of configuration of multiple lines with first item as available storage and remaining are the process at different rate using ...
7
votes
2answers
92 views

Counting SKUs that have not appeared in previous orders

I need help with optimizing my Python code. I have a bunch of orders and each order has several SKUs. This is what my data looks like: ...
1
vote
0answers
21 views

Searching through a TreeView by expanding found results and collapsing others [closed]

I have a WPF TreeView which is populated with many child controls. All of them with children themselves are ...
5
votes
2answers
43 views

Optimizing Python loop with Numba for live load analysis

I have written some code that computes flexural moments imposed by different trucks for a bridge with 300 ft length. Truck data are contained in two lists: ax_list ...
2
votes
0answers
168 views

Printing new items from Nike.com to Discord

I have been playing around with Nike API. What I have created is a monitor which checks for new products on Nike.com and whenever there is a new item coming in then it should print it to be through ...
5
votes
3answers
100 views

Java version of card game “higher or lower”

First of all, I have my basic main method which does pretty much nothing: ...
4
votes
1answer
56 views

Packet process time simulation using queue

Here is my code for the below packet time simulation problem using queue. My code works correctly but it's slow, please help with suggestions to improve run time and other suggestions for performance ...
6
votes
3answers
166 views

Custom integer parser optimized for performance

I want an integer parser so fast it risks discovering time travel. I'm stuck in C# for a language, but that doesn't mean I can't try to use c++. So I wrote the following: The best I could do ...
3
votes
0answers
36 views

Data set generation with Python and Matplotlib

I want to use Python and Matplotlib to create a data set of images. I want to do this by transforming the plot to a numpy matrix. At the moment it takes about 0.1 second to generate 100 images of size ...
0
votes
1answer
43 views

Map value to color rgba

I wrote this function to map value to a color I am looking for some general feedback on how I can improve the efficiency of the function. and if there is better way to do it. ...
3
votes
2answers
61 views

Changing the width of a centered progress bar

I am making a game in which the player has a certain amount of available boost. To show this, I am using a blue bar inside a black frame. The bar can grow and shrink at different rates as available ...
4
votes
2answers
61 views

Macro to convert an indented hierarchy to a database format

Our business intelligence suite outputs data as an indented hierarchy, as below: ...
1
vote
1answer
53 views

Java Regex for Chess notations

I have this regex: (\d?)[A-Za-z](?=(\d?)(.*))(?=(.* ){5}) It would be used by me for Chess FEN strings. I wonder if regex ...
2
votes
1answer
28 views

Search and Replace (FreeCodeCamp intermediate algorithm scripting)

I completed the challenge and passed the tests: Perform a search and replace on the sentence using the arguments provided and return the new sentence. First argument is the sentence to perform ...
2
votes
1answer
77 views

Buy and Sell a Stock for maximum profit (given a day and a price)

If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock), design an algorithm to find the maximum profit. Example one: Input: [7,1,5,3,6,4] ...
2
votes
1answer
156 views

n choose k combination in JavaScript

I was asked to solve a problem for \$\binom{n}{k}\$. I did the following implementation and am wondering if there's any feedback. Input: n = Integer ...
2
votes
1answer
46 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-...
2
votes
0answers
31 views

CUDA kernel to compare matrix entries, weighted with a pattern

I wonder if it's possible to optimize this code in CUDA. Could I get any hints how to? Equivalent algorithm runs faster in Matlab for me, but there I'm doing matrix operations. Compution I'm not ...
1
vote
0answers
23 views

JavaScript loop to copy JDBC query results to a 2D array

I have a JS running in Google App Script, but for me, it's like an overall example/problem I ran into more often. The script fetches via JDBC the results of a MySQL query. The result has about 60.000 ...
1
vote
1answer
51 views

Importing text into PANDAS and counting certain words

Aim: To improve the speed of the following code. Current timing is about 80~ hours :0 Purpose: The code imports a dataset which contains 1.9 million rows and two columns. One of these columns ...
2
votes
1answer
70 views

CodeIgniter method to get requests for superiors to approve

I'm currently working on an approval system right now using PHP (Codeigniter) and I have this method of getting all the requests according to your department group and position depth. The checking of ...
4
votes
0answers
171 views

Asyncio HTTP Request Queue

I wrote a simple sitemap.xml checker using asyncio and aiohttp. I followed the documentation demonstrating the producer/consumer pattern. However, I noticed that as the URLs scale larger, it seems to ...
6
votes
3answers
184 views

Custom double parser optimized for performance

I'm trying to beat the native Double.TryParse for performance in parsing large multi-million row (simple) CSV files as much as possible. I do not have to support ...
2
votes
2answers
41 views

Making the font as big as possible without overflowing each div

I made a function that makes font sizes in <div>s as big as possible without overflowing. It takes a long time to run. How do I optimize this? ...
5
votes
0answers
49 views

HoloLens Unity program

I recently finished writing an HoloLens proof-of-concept program. It involves generating a user interface based on a connection with an OPC server. OPC involves industrial PLCs, one or more PLCs send ...
1
vote
0answers
44 views

PHP approval system [duplicate]

I'm currently working on an approval system right now using PHP (Codeigniter) and I have this method of getting all the request according to your department group and position depth. The checking of ...
2
votes
1answer
26 views

Tone Mapping image manipulation

This code is extremely slow and ideally I would appreciate someone walking me through getting this going on the GPU, but if nobody has time for that which is understandable, any and all optimisations ...
5
votes
0answers
59 views

Implementing numerical integration in Python

I have this Python code that implements a rectangular numerical integration. It evaluates the (K-1)-dimensional integral for arbitrary integer \$K \geq 1\$ $$\int_{u_K = 0}^{\gamma}\int_{u_{K-1} = 0}^...
6
votes
2answers
159 views

Append to compressed tar file with performance

As you might know, Python's tarfile does not have the ability to append to files compressed with e.g. gz or ...
3
votes
0answers
36 views

Rabbit MQ long running de-queue by using IEnumerable yield return

The following code attempts to efficiently stream queue messages to processing units using an IEnumerable yield return. create a blocking collection to handle the stream create a linked token source ...
3
votes
2answers
90 views

Show all primes in go

I'm trying to go through Adrian simple programming tasks; Elementary task 8 It's basically asking for an infinite loop to print every prime number as it finds it. Are there too many ...