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)

0
votes
1answer
14 views

Sort by year and day descending, yet time ascending

I recently discovered a hugely inefficient portion of code in my program, and have gone about rewriting it. I am however, not quite sure if the rewritten program actually does exactly what I want, due ...
1
vote
0answers
17 views

Concurrent non-blocking update of cached list of on-line users

I have following problem: My server (ASP.MVC WebAPI) is tracking, when client application ("Agent") is on-line. It's storing this inf on following table: ...
0
votes
0answers
14 views

My Website Script loading takes a long time [on hold]

StackExchange Code Review community. I'm currently building a Forum out of Pure AngularJS. What I'm asking is why is my website loading so slow for some reason. I'm Guessing there are multiple ...
-2
votes
0answers
12 views

How can I change my code using SIMD/AVX to calculate ranks in my page rank algorithm? [on hold]

I am writing a page rank program. I am writing a method for updating the rankings. I have successful got it working with nested for loops and also a threaded version. However I would like to instead ...
2
votes
2answers
27 views

Bash script to perform LUHN check

The following Bash script takes a single parameter (the PAN) and exits with 1 if the PAN does not satisfy a LUHN check. ...
7
votes
3answers
727 views

Calculating the amount of cubes needed to form a sum

Since I've never done any performance programming (Aside from the better choices such as array vs list etc. The real basics.), I should probably read up on it. But I had to start somewhere, so, ...
2
votes
1answer
15 views

Random walker using Processing.JS on Khan Academy, with new walkers generated on mouse click

I've created a project on Khan Academy as part of the Natural Simulations course on random walks. This project is in JavaScript, using the Processing.JS library, slightly modified by Khan Academy. ...
1
vote
1answer
28 views

Object key diff

I've been tasked with finding property differences in massive JSON structures and return them in a particular fashion ([key_1.key_2, key_1, etc]). Here's my code, which is focused on readability so ...
1
vote
0answers
32 views

Mongoose schema for products and social media posts

Here is my current Schema Brand: ...
-1
votes
0answers
16 views

Optimization of matlab code

I am relatively new in MATLAB and my major problem is optimization. My code seems to run very slow and I can't think of any way to make it faster. All my arrays have been preallocated. S is a large ...
0
votes
0answers
30 views

Codility Fish Test 50%? [on hold]

I am getting a 50% overall mark (75% correctness and 25% performance) on the Codility Fish problem and my solution seems to be O(N) but I am only getting 25% performance. The results can be seen here ...
4
votes
1answer
109 views

Maximum profit from buy and sell offers

Given a list of sell offers and a list of buy offers for an item I want to determine how many units to trade for maximum profit. Each offer consists of a price and a maximum amount of units being ...
2
votes
1answer
59 views

Algorithm for Tic Tac Toe

Currently, I am using an algorithm that finds the best move based on the existing states of the board. Is there a better way to do it? Is there a data structure that I can use? I have also considered ...
1
vote
1answer
30 views

Parallax animation running well on Chrome but slow on Safari

This is the continuation of a previous question I posted here. I've improved (at least I think so) the initial script from the previous question, now storing the data in an array, it runs slightly ...
0
votes
0answers
22 views
6
votes
4answers
786 views

Detecting if two strings are anagrams using TreeMap

I decided to use Java TreeMap because it seems like a great data structure to fit this problem. However, I am not sure if there could be much simpler methods using ...
7
votes
0answers
30 views

Interpolating data of multiple trains

I have written a piece of VBA code to essentially replace a complex formula that I was using in the Excel cells. I have the data on Sheet2, which describes multiple train journey's along the same ...
7
votes
2answers
45 views

Higher performance reading shorts from binary file

I just got rejected at the tech interview of a job application. They gave me the following exercise for me to complete: They gave me a binary file with 10 million pairs of 16-bit signed integers. ...
2
votes
2answers
46 views

Show and Hide group of classes based on data attributes

Somebody please verify this code. Is this efficient? please tell me modular way to accomplish this task. Updated I want to add show class to ...
1
vote
1answer
105 views

Creating archive from over 3GB of files in less than 1 minute

This is a follow up to this question. I got some very good answers for my process speed, and wanted to go ahead and share what I've done with the program. The new updates of the program consist of the ...
4
votes
2answers
77 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 ...
10
votes
1answer
536 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 ...
5
votes
1answer
79 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
24 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
19 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 ...
4
votes
0answers
42 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
53 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 ...
5
votes
1answer
71 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 ...
11
votes
2answers
185 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
75 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
41 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 ...
4
votes
2answers
70 views
+100

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 ...
7
votes
2answers
251 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
77 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 ...
2
votes
1answer
65 views

Graphic Ape Designs gallery website

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
24 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
49 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
27 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
1answer
26 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 ...
0
votes
1answer
69 views

Calculate the arclength

I am trying to estimate a good approximation for the arclength of the curve \$ y = \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 ...
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 ...
9
votes
2answers
129 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
115 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
71 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
95 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
20 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 ...
4
votes
2answers
92 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
78 views

Let's play Scrabble

Problem: Write a program that, given a word, computes the scrabble score for that word. Code: ...