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

learn more… | top users | synonyms (4)

2
votes
2answers
21 views

Reduce as many adjacent chars as possible in string

This code is meant to reduce a given string as much as possible by deleting adjacent characters. Here are some examples: ...
1
vote
0answers
9 views

How to make query run faster when using sub-query

First part of the query grabs Policy's Premiums, Effective and ...
1
vote
1answer
32 views

Python program for testing the Collatz Conjecture

This is a simple program to test if integers will follow an interesting, improvable statement that if disproven, calls for a bravo. But, ignoring the pretentious poetry, this code allows the user to ...
4
votes
1answer
201 views

Converting HEX values to Unicode characters

I have a small bot for social network, which accepts message "unicode XXXX XXXX XXXX ...", where XXXX - HEX values which I ...
5
votes
5answers
223 views

Another DataGrid (ObservableCollection) Filtering Method

I have re-written my DataGrid filtering method to try to improve performance and I feel that although this is the fastest yet, there is still room for improvement ...
1
vote
0answers
27 views

Computing the weighted centroid dependant on previous row/column

I am working on a project for a raspberry pi that requires some image processing. The aim is to find a white line on a black background by finding the weighted mean in each row/column. However to ...
7
votes
2answers
324 views

Who are these lurkers?

Last night in The 2nd Monitor there was a discussion about postless users - I wanted to see how many there are, whether they're one-timers that showed up once, registered and never came back, and ...
0
votes
0answers
16 views

Updates values in master table based on conditions, then refreshes pivot table

There is significant screen updating going on with my code when I run it. The macro is being ran from a button where the textbox is. "JobCol_Master" is a sub-range of a column in the master table on ...
0
votes
0answers
14 views

UDFs with Header-Case selection is too slow

I am working at a project where we implemented 10 different UDFs which gave us high flexibility and a clean code but basically screwed the file up as the file got super slow in the end: The problem is,...
0
votes
1answer
67 views

Calculating the difference between 2 arrays

I made this function to calculate the difference between 2 arrays and return it in a third array. I'm using this function as a part of stocktaking functionality I apply in my accounting system. ...
3
votes
1answer
34 views

Bot-like Spring Java service for checking advertisements

I am in the middle of developing a Spring Boot application, which has a service acting like a bot. advertisementService.update(Advertisement ad) is a method which ...
3
votes
4answers
91 views

Optimizing algorithm of analyzing incoming data

I've been making an app, which gets data from external device (via bluetooth) and displays received data. I'm still pretty new to programming and I'm struggling to finish this app. I wrote some code, ...
4
votes
1answer
98 views

Efficiently creating a list of formatted hex values

My background is in C, and I'm finally learning this new-fangled "Python" that all the cool kids are talking about. I want to create a list of formatted hexadecimal values like so: ...
3
votes
1answer
33 views

Loads two columns from excel - cleans up the data - and makes a new list of unmatched values

I am comparing two columns of data (~20k rows) to find the items that do not match. Actually one of my files is an export from an Oracle database, but I have not gotten to the point of working with ...
2
votes
3answers
59 views

User Profile page - code quality , security & Performance feedback

once user login, we are displaying all the information of user in profile/account page. please check code quality , security & Performance. ...
1
vote
0answers
63 views

Optimizing Python Code in terms of Time - Recursive Function

I wrote the following code but it takes a lot of time, about 20 seconds. The code has recursion and the recursion depth doesn't exceed 100 in any case. When it is run a sufficient amount of times ...
2
votes
0answers
31 views

Optimize iteration over numpy array with vectorize [on hold]

I have the following method which deals with numpy arrays to find the cumulative minimum from each element and its neighbors above: ...
3
votes
1answer
74 views

Python script which translates a DNA sequence

For my Biology class, I made a Python script which takes a DNA sequence as input, translates it into an mRNA sequence, and then again into a tRNA sequence. It then matches each mRNA codon with an ...
3
votes
1answer
50 views

Timer functionality in Python

I am trying to implement Elapsed Timer in Python (version 3). The clock and time methods in Python seems to have different ...
-2
votes
1answer
52 views

code structure improvement in c++ [on hold]

I'm trying to optimize an excerpt of an old code. What kind of improvements comes to your mind? by (a) removing the inefficiencies that you can find and (b) giving the code a better structure, if ...
2
votes
1answer
71 views

1010! game implementation with bruteforce AI

I made a program which is supposed to be an implementation of the game 1010! with support for custom AI agents, minus some pieces available in the original game. It works great for the 1 agent that I ...
3
votes
1answer
67 views

1 Vase 3 Vessels game in C++

Here is the premise: Three women robbed a gentleman of a vase, containing 24 ounces of balsam. Whilst running away they met a glass-seller, of whom they purchased three vessels. On reaching a ...
4
votes
0answers
50 views

Graph Python challenge 2 (revised)

I'm looking for ways to optimize a function that I wrote as an answer to this problem in Python: You and your rescued prisoners need to get out of this collapsing death trap - and fast! ...
3
votes
0answers
22 views

Optimizing rendering with a lot of transformations and save/restore

I have implemented a renderer for shapes described with a L-System grammar. Implementation of that is not important. Basically you feed it an angle and some rules, and it spits out a string of ...
4
votes
1answer
47 views

Compute the XOR of all the elements in the upper left triangular of a square matrix

Given a dimension \$D\$. We generate a \$D\times D\$ matrix with elements that start from \$0\$. For example, if we're given a dimension \$4\$ this is what our matrix looks like: $$ \begin{bmatrix}...
1
vote
0answers
30 views

Euler Project 14 (Longest Collatz Sequence)

Project Euler 14 asks: Which starting number, under one million, produces the longest Collatz sequence? I've been trying to optimize this solution to execute in less then 1s. Agenda for first 50 ...
0
votes
0answers
22 views

Hackerrank Lower Bound-STL

This is still my first week of learning C++, I solved the lower bound STL challenge in Hackerrank Lower bound STL but I'm having time exceeded issue for long input. I'm open to constructive criticism, ...
3
votes
1answer
53 views

Keep elements present an odd number of times in an unsorted vector

From an unsorted vector of integers, I would like to keep only elements that are present an odd number of times and have them sorted. Below is an example of a working code. ...
0
votes
0answers
29 views

Protecting a cyclist from rain

The input consists of an integer, N, that determines the no. of km of the cyclist's route and an integer, K, that determines the ...
1
vote
1answer
50 views

Interleave data using Java

...
4
votes
0answers
97 views

Assembling and traversing a tree, given a list of items and parent pointers

I've written a function which takes input such as this: ...
4
votes
1answer
61 views

Finding the indices where a selected player appears in a list of hashes

I have an array of hashes in a YAML file. When I run the code below it is VERY slow. My YAML pwsarr.count is about 2000. I am somewhat new to Ruby so I don't know ...
3
votes
1answer
68 views

Populating a form with filtered hierarchical place names

My server performs a query to get all country data with Eloquent relationships: ...
-1
votes
0answers
29 views

Optimize a foreach [closed]

I have a trouble with the time to get values from a database to a list in Android App. How to optimize the foreach of the code? I have 1500 products in 34 categories, the query result is 25 secs., I ...
2
votes
2answers
45 views

Binary Tree Inversion

I solved this problem. Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 To this ...
3
votes
3answers
30 views

Summing durations associated with each MAC address in a MongoDB result

I have a script which get data from MongoDB in the form of array and show the result. The array has a number of records in the thousands. A sample array is as follows: ...
8
votes
2answers
103 views

Color substitution in a BufferedImage

The setPixelColor function below changes the color of pixels. I need some suggestions to optimize this function. Example: ...
3
votes
1answer
78 views

Image processing: rotation

I've made two functions for image processing: First one is for rotating an image Second one is to set all pixels of one color to another color Rotate Image: ...
3
votes
1answer
44 views

Hash-optimization and Wilson-maze generation algorithm

I've finished optimization of Wilson algorithm (maze generation) from "silly and slow" algorithm of choosing unvisited cells: ...
2
votes
0answers
49 views

Download a PDF and submit it as a print job

I have following Java code, which is to print PDF, but in a busy location this code is taking about 20 to 30 second delay before submitting to the hardware. get the PDF file via the network download ...
3
votes
0answers
42 views

2D grid container with arbitrary multiple data types

I've been toying with the idea of making a simple game. In game development, it is good to do things in a more struct-of-arrays style rather than arrays-of-structs style, due to cache locality. ...
4
votes
0answers
50 views

Retrieving website categories from a three-level hierarchy

I've been trying to fix this performance bottleneck in my web app for a while now. Here is what the data looks like on my web page: Here is how I get this data in the controller: ...
3
votes
1answer
114 views

Python graph challenge

I'm looking for ways to optimize a function that I wrote as an answer to this problem in Python: You and your rescued prisoners need to get out of this collapsing death trap - and fast! ...
1
vote
1answer
46 views

Restoring data from database to list with SQLite

I have a Winforms project in which I have a screen which loads a questionnaire. It restores answers the user has previously entered by restoring the saved results from the database to a single list (...
4
votes
2answers
56 views

Optimize text search in files with Bash

I would like to get some performance improvement suggestions to a simple project I made using Bash in Linux. The target is to read all the *.desktop files, and ...
3
votes
1answer
29 views

Python: Loop through folders, convert XLSX files to CSV removing non ASCII

As the subject suggests: Loop recursively through folders All files are XLSX Remove all non ASCII characters Save as a CSV Can it be improved with regards to speed? Would using ...
0
votes
1answer
50 views

String reorder by integers

The aim is to have any strings with integers within to be reorder by these integers. Let's say you have the following string: re5 Forty1 cash2 Man3 Booker4 The ...
7
votes
4answers
113 views

Calculate the number of palindrome numbers in the given ranges

I've written a program that calculates all of the palindrome numbers in the given range, but the code is slightly slower than needed. I've tried to improve algorithmic complexity to the best of my ...
0
votes
0answers
14 views

Wyld: Lightweight Javascript tool for creating input-output mappings

I've created a lightweight library for handling input-output mappings by just using a "configuration" object as the map. Here's a snippet of the README: To create a direct mapping from an exact ...
2
votes
0answers
17 views

Google App Engine - Blog Post & User Profile Handler

I am currently developing a web app that lets users submit posts and replies, and they can have their own profile which lists all the submitted posts and replies. I am also using X-AppEngine to fetch ...