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
6 views

Copy, Paste and Format 2.0

This is a follow up with revised code, see the original question and subsequent answer in the following link (Copy, Paste And Format) This is a full version of all three "Macros" or subs within the ...
8
votes
1answer
273 views

Copy, Paste And Format

I am currently working with this code to automate some tasks for senior staff members that are not very adept in Excel. Wondering if VBA is simply not a very quick code or if my code is clunky and ...
2
votes
1answer
27 views

Parallax animation, running well on Chrome but slow on Safari

I have the following script to create a parallax effect on the page using request animation frame, it runs well on Chrome, but on Safari is lagging, I think because I run too many calculations on each ...
1
vote
0answers
8 views

Estimate Hidden Markov Model with both continuous and discrete observations, possible missing data

My code estimates a Hidden Markov Model (HMM) using the expectations-maximization (EM) algorithm. I followed https://www.princeton.edu/~rvan/orf557/hmm080728.pdf with modifications to allow for panel ...
0
votes
0answers
9 views

Php Ajax script to check server status of sites from db

I am writing a script for a client so hey can check the status of their servers. The script performs ajax requests to get the data as json then poulates the table with the returned json results. is ...
2
votes
0answers
20 views

Matrix of heights test

I was writing a program for my math class because my Professor asked me to. The problem is as follows: 300 people are arranged in 30 rows each of 10 people. The tallest of each row is chosen, and the ...
2
votes
1answer
37 views

Beating a dead horse: Project Euler 4

The task A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the ...
4
votes
1answer
51 views

Speeding up process time while archiving files

I asked this question on Stackoverflow, and was told I might have better luck here. I'm new to c# and have created a basic file archiver. It works, and it does what it's suppose to do, but I think ...
10
votes
2answers
125 views

Python 3 decompression routine 10x slower than C# equivalent

I'm relatively new to Python 3, especially IO programming, writing a Blender add-on to import model data. The model data is available in a custom compression, and I originally wrote code in C# to ...
-1
votes
2answers
62 views

Code efficiency - Piglatin

My code works and does what it is supposed to. However it needs to be more efficient. Could anyone help me tidy this up and show me where I could perhaps not rely on large loops (which it does a lot ...
2
votes
1answer
39 views

Raindrops in Java

Problem Statement: Write a program that converts a number to a string, the contents of which depends on the number's prime factors. If the number contains 3 as a prime factor, output ...
3
votes
0answers
20 views

Find group of available stalls in an aisle

An aisle is defined as two rows of six stalls each. A stall is adjacent to another if it is directly next to it or across from it. My method finds out how many stalls can be found in a chain from ...
6
votes
2answers
234 views

Card-fighting game Part 2

Information: This is part 2 of the game I am building. After some good feedback on my first post I decided it was time to post my updated code. The differences in this part are: Updated code after ...
5
votes
2answers
69 views

Movement around a large map

I'm trying to make a small shooter game, where you can only see a small portion of the map around you. The map will also be much larger then the actual JPanel (The panel is 1000 by 1000, the map ...
-1
votes
0answers
36 views

Website optimization

I am currently working on my YR9 (I'm 14) IST web development project and I want to know some tricks for optimizing my website. I know that I shouldn't have the same CSS rules in the style tag on ...
0
votes
0answers
23 views

MySQL stored procedure to search medical insurance claims

This stored procedure is taking a lot of time to execute. How can I optimize this query? ...
3
votes
3answers
46 views

Binary string to decimal conversion

Problem Statement: Write a program that will convert a binary number, represented as a string (e.g. '101010'), to its decimal equivalent using first principles Implement binary to decimal ...
1
vote
1answer
21 views

Slow Filtering Method on DataGrid

Sometime ago I asked a question regarding a slow Filtering method for my DataGrid. Months later and I have a relatively quick method, though I am still looking to ...
1
vote
0answers
14 views

Unexpected result when trying to optimize code

I'm writing a module to procedurally generate a map of islands. What it does is choosing for each chunk some points inside that chunk that work as the center of each island, then for each tile on the ...
2
votes
0answers
45 views

Calculate the arclength

I am trying to estimate a good approximation for \$\sqrt{1-x^2}\$ for \$x \in [0, 1]\$. I did this using a Bezièr curve, and made it so that the area under the two curves are alike. In order to ...
2
votes
0answers
25 views

Adding messages to a new user record

I've a User and Notification Entity relationship as: ...
1
vote
0answers
28 views

Optimizing a Java solution to Project Euler Problem 23

I've tried to make something optimized for the Project Euler problem 23, named "Non-abundant sums". I've fine-tuned my solution to the following: I added divisors to the slots of each number to ...
7
votes
2answers
116 views

Pokemon game in JavaScript

I'm practicing my JavaScript skills by trying to create a Pokemon game. So far, I've made the dataset and the functions required to work the game. Can someone help me optimize the code and tell me why ...
1
vote
0answers
28 views

Deleting all points in a quadrilateral

I have a sorted (by x value) ArrayList of points and four separate points that make up a quadrilateral. My code deletes all points in the ArrayList that are inside ...
4
votes
3answers
114 views

Pythagorean triplet adding up to 1000

Project Euler problem 9 says: A Pythagorean triplet is a set of three natural numbers, \$a < b < c\$, for which, $$a^2 + b^2 = c^2$$ For example, \$3^2 + 4^2 = 9 + 16 = 25 = 5^2\$. ...
3
votes
2answers
70 views

Print list item in a rectangular frame

The aim is to have that list ["Hello", "World", "in", "a", "frame"] And make it printed like below ...
4
votes
2answers
93 views

Optimise nested loops used to compare champions which have abilities which have effects

I'm creating a counter picker for a game called League of Legends, and for this I need to compare effects of abilities, which each champion has. For this I'm using 4 lists of champions, the ...
0
votes
0answers
16 views

Laravel transactions with a database

I'm really concerned about my transaction with a database and my code structure. I have created more methods to insert, update, delete data to the database but sometimes some of them will break or ...
3
votes
2answers
83 views

Sum of numbers that equal 100

I was asked to find all the numbers that added up to 100 with no duplicates in Ruby. I float between Python, GoLang, and Ruby in a day. I am always concerned if I am doing something in the most ...
2
votes
2answers
76 views

Let's play Scrabble

Problem: Write a program that, given a word, computes the scrabble score for that word. Code: ...
3
votes
0answers
45 views

Optimising looping through large data set and updating database

I have a database table storing information about documents (MigrationMaster). There is another table with security information on these (DocumentSecurity). There are 4 steps I can see that I need to ...
3
votes
1answer
47 views

Spring controller code to group information by date

I'm using the Spring Framework in my web application and I'm curious as to whether my controller implementations are good or not. I've used many Hashmaps to make a object that serves my purpose for ...
12
votes
12answers
2k views

Project Euler 8: Maximum product of 13 adjacent digits

Problem 8 on Project Euler which asks Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What is the product? This is my solution in Visual C#. ...
3
votes
3answers
425 views

Finding the tree height in Python

I'm trying to get an efficient algorithm to calculate the height of a tree in Python for large datasets. The code I have works for small datasets, but takes a long time for really large ones (100,000 ...
0
votes
0answers
39 views

Block a partcular machine for a particular period of time interval after x failure

This is an extension to this question I am working on a library which makes Http call to my service. I have below two requirements: If my service machine doesn't respond back (there is a socket ...
3
votes
4answers
75 views

Find out the number under 1 million which produces the largest Collatz Sequence

So, I have written a code which calculates the number under n( 1 million in this case) which produces the largest Collatz Sequence in that ...
5
votes
1answer
89 views

Caches implementation in C++

I had a test task for internship where the main part was in implementing fixed size caches with different displacement policies (LRU/LFU/FIFO). I did that task, but was refused afterwards. Now I am ...
4
votes
4answers
136 views
+100

Subdividing intervals that contain the largest error values

I'm trying to accomplish the following: Start out with 1 interval on the real line. This interval is processed in some function and out comes an array of errors (size < 10 usually). The maximum ...
6
votes
2answers
69 views

Parsing locally stored HTML files

I am working with this code to parse through HTML files stored on my computer and extract HTML text by defining a certain tag that should be found: ...
0
votes
0answers
37 views

Find matches between two tables after downsampling

I am trying to find matches between two tables by downsampling so that they fit into memory and we are able to find a good number of matches. For one of the tables, I have created an inverted index on ...
1
vote
0answers
28 views

Give the variable length permutations (combinations) of a set of strings

This code is a proof-of-concept which I intend to convert into a static utility / helper class. I'm looking at this review from a structure or performance viewpoint. Small detail such as whether it ...
3
votes
1answer
46 views

Extracting coordinates file that are inside a bounding box

I'm scanning a CSV file to see which values fit inside of a given box. The CSV file has X and Y coordinates, and the arguments to the function are the perimeters of a box (i.e, top, bottom, left side, ...
0
votes
0answers
16 views

Remove overlapping n-grams

I'm trying to write a compression algorithm that works by splitting the input into n-grams, and it's working, but I've start to run into a problem. This piece of code is supposed to remove ...
3
votes
2answers
79 views

Obstacle-spawning and movement scripts

I have these scripts I made that work absolutely perfectly as I need them to. Is there any improvements that can be done to these scripts and make them more efficient for Mobile Platforms? Or even ...
7
votes
0answers
177 views

Efficiently using Apache HttpClient in multithreaded environment

I have a library which is being used by customer and they are passing DataRequest object which has userid, various ...
6
votes
1answer
96 views

Palindromes that are sum of consecutive squares

I have been working on a Project Euler: 125, which took me ages to solve. The problem and source are cited below The palindromic number 595 is interesting because it can be written as the sum ...
0
votes
0answers
24 views

Three functions to make a JSON array

Currently I'm using these three functions, that in the end produces a JSON array. I went this way so that I could fetch data from a specific table. But now it just seems bloated and poorly written, ...
3
votes
1answer
34 views

Converting images to greyscale using JuicyPixel

I would like to use Haskell to do some image processing so I have been writing small programs to test performance. I wrote a program to batch convert PNG images from color to greyscale. I compared the ...
3
votes
2answers
97 views

Largest palindrome product

From the Project Euler challenge series: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest ...
2
votes
1answer
76 views

Finding the two largest three digit numbers missing from a text file

Hear this problem: Write a C/C++ program that reads all the values from the "BAC.TXT" file and determines which are the two largest three digit numbers that are missing from the file using a ...