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
0answers
4 views

python - merge-sort algorithm or kind of

I tried to reproduce the merge-sort algorithm. It was tough as my understanding of list was less than stellar, a few days ago. I will be honest, I'm ashamed of what I did but I tried to finish it ...
0
votes
0answers
18 views

Form validation library

I am writing an open source library but its been to long since I have worked in JavaScript. Here is the initial working code fragment: ...
0
votes
0answers
12 views

Linking and cross linking from SQL to MySQL speed performance

I have a nasty query. I'm hoping maybe there is a way to improve it's performance. As far as I am aware my hands are tied. We have a SQL Server we use, but our phone system databases are housed on ...
4
votes
2answers
44 views

Rectangle-segment collision detection

I am working with C++ and SDL, hoping to create a game later. I am implementing the collisition detection between rectangles and segments. I found this (NateS user's solution) about line-rectangle ...
0
votes
0answers
16 views

Dataframe helper in R

In order to have a "unified" (I realize how ambitious this actually is) syntax when working on dataframes, I wrote the following functions that is a general purpose dataframe set of tools in R. ...
6
votes
3answers
56 views

Loop through a unique combinations driven by choices

I am trying to optimize my code and make it as fast as it can be, I have researched as much as I can and am now asking the community for any tips because there are definitely people more experienced ...
0
votes
0answers
10 views

Add and merge 2D array items so no nested duplicates on the outer array

this.collisions is a 2D array containing a list of collisions that, when bodies collide, they should be added to it. Here's an example: ...
3
votes
1answer
30 views

Inserting data into a file

So, given a file with the following format: [header] line of data line of data line of data line of data [header 2] line of data line of data line of data ... I add a ...
7
votes
2answers
69 views

Sum of prime factors of binomial coefficients over 9000!\${}\$

The problem I have lately been working Project Euler: 231: The prime factorisation of binomial coefficients The binomial coefficient \$ ^{10}C_3 = 120 \$. \$ 120 = 2^3 × 3 × 5 = 2 × 2 ...
2
votes
1answer
42 views

Queries for the number of users seen each day

The below code returns an array filled with the number of users last seen for each day for $dayCount number of days that is specified via a parameter into the ...
1
vote
1answer
93 views

Merging two square matrices

I would like to optimize a snippet of code, which uses a multiple nested if statements. I am looking for a formula to make it as a combination of multiple arrays ...
2
votes
2answers
61 views

Merge sort Python implementation

Is this efficient? ...
4
votes
1answer
102 views

Clearing filters, copying a range, and then pasting a formula down a row

Novice coder here. I have the following code to perform a few actions like clearing filters, copying a range, and then pasting a formula down a row till the last line. It works perfectly, but it ...
2
votes
1answer
47 views

Scrolling game very slow

I am trying to make a scrolling game in Tkinter. However, with all my for loops and functions it is extremely slow. I am reading the tutorial from Khan Academy's advanced JS. In their JS game ...
-4
votes
1answer
127 views

C-type classes in C++

I have written some improved C-type classes in C++ and wondered whether these are suitable for professional use or in which way they would have to be improved to be professional or more powerful. ...
10
votes
4answers
550 views

Copying values from one sheet to another

I am trying to copy values from one sheet to another using loop with two conditions and it is very slow. Removing conditions from code doesn't have any effect on the speed of the execution. I already ...
4
votes
2answers
83 views

Get every information about the Reservation

I'm developing a plugin for Revit (a software to make 3D buildings). The goal is simple to understand. When there is an intersection between a Wall and a Duct I create an object called Reservation at ...
4
votes
2answers
84 views

Social network queries for profiles, posts, and followers

The code below is for a social networking system. The problem is that when there are many posts and many followers, the performance is slow. Is something wrong with the queries and the script below? ...
3
votes
1answer
69 views

Enum string parse and get custom attribute assign to array

I wrote a code which: - parse string to my enum - get description from enum - assign to string[] array ...
4
votes
1answer
56 views

Vectorizing a biometric matching score calculator

I am working on a biometric matching system and I would like to have few suggestions regarding vectorizing the following code: ...
0
votes
1answer
68 views

Project Euler #50 Consecutive prime sum

I'm having trouble optimising the project euler #50 exercise, it runs for around 30-35 seconds, which is terrible performance. The prime 41, can be written as the sum of six consecutive primes: ...
4
votes
1answer
68 views

Comparing three data structures for dealing with probability distributions in Java

Introduction Suppose you are given three elements \$a, b, c\$ with respective weights \$1, 1, 3\$. Now, a probability distribution data structures will return upon request \$a\$ with probability 20%, ...
0
votes
1answer
68 views

Password Protect Page with PHP

I am using the following code to password protect pages on my site. This is how I am including it on a page: ...
0
votes
0answers
26 views

Returning direct status changes of user statuses

I have a query which returns direct status changes (no intermediary changes) of user statuses: ...
-1
votes
2answers
63 views

Finding consecutive occurrences of a value in an array

Given an array, return True if the array contains consecutive values: ...
2
votes
1answer
44 views

Pig Latin converter in Python

How is it and can it be optimised? ...
4
votes
1answer
43 views

Bottom up (iterative) mergesort in C

I have this C implementation of the bottom-up (iterative) mergesort: mergesort.h: ...
9
votes
5answers
820 views

Macro code that removes excess rows

I'm a business student who just started to learn VBA. I am trying to write a macro for a project but only have minimal experience actually stepping into the code. The macro I have written is to ...
5
votes
1answer
76 views

High performance triangle - axis aligned bounding box clipping

Implementation of a Robust (i.e. with a finite plane thickness) Sutherland–Hodgman algorithm for clipping polygons against an axis-aligned bounding box. I use the following code only for clipping ...
5
votes
3answers
113 views

Bubble Sort in Objective-C

Following is Objective-C method implementation I did for one of the most simplest sorting algorithms, Bubble Sort to sort an array of integers. Note:- I have defined it as a static method in the ...
0
votes
1answer
19 views

Node function to walk through file system and make sure it has a matching db record

I have an app that uses the file system a lot to store generated files (zip files and scss/css fil). When a user generates a file, the metadata and other information is stored in the db for later ...
4
votes
5answers
123 views

Test four int of commonality in the lower four bits

The four parameters a, b, c and d can be ...
3
votes
2answers
118 views

Counting multiples of 3 or 5 using threads

I have a modified version of the first Project Euler problem — where I find the sum of all the numbers below the value 2100000000 that are multiples of 3 or 5 using a multi-threaded program. The ...
3
votes
0answers
68 views

CUDA program that emulates a kind of cellular automata slower on the GPU than on the CPU

I'm a very new to CUDA, so I'm still trying to understand how to make the best use of the GPU. I've ported a C algorithm to it. This algorithm works by loading the memory with an initial input, then ...
5
votes
2answers
107 views

Mars Rover Simulator

Problem Statement Consider a rover and a plateau of size nxn. The rover takes three type of instructions L,R and M. 'L' and 'R' rotate the rover in the left and right direction. 'M' moves the ...
0
votes
0answers
39 views

JS timer plugin

This code operates as intended, but with only with two operational timers running. I need the resize event in the match section as I need to retrieve the window ...
1
vote
0answers
10 views

Optimize query from xml column

So I have a query like this: ...
3
votes
0answers
125 views

Data model for complex tree (multiple children and multiple parents)

I'd like to have a discussion on the data model (mostly) for a tree with nodes having multiple children and multiple parents. I already have a working algorithm, but I'm looking for improvements. The ...
3
votes
1answer
81 views

Quickly applying gravity force between bodies

I have a function for applying gravity forces between every possible pair of bodies on my game. It is the most used function, and can run more than 100k times per frame so every minor improvement on ...
3
votes
1answer
64 views

Stack from Linked List

I have written a program that takes a linked list and then converts it to a stack. I would like a code review for my program. Thanks in advance. Stack.java ...
5
votes
1answer
124 views

Computation of product of permutations

Given a graph \$G = (V,E)\$ with a unique labeling of each vertex, let the transposition \$(i,j)\$ (where \$i,j\$ are the labels on adjacent vertices) represent selecting an edge and swapping the ...
4
votes
1answer
97 views

Simple binary search tree for use in programming competitions

I made a binary search tree implementation in C++ for my personal use in programming competitions. ...
3
votes
1answer
63 views

Simple Vector2D and 3D class

So I implemented a simple vec2 and vec3 classes, I wanted to know what remarks you guys can give me to improve it. I try to work with c++11 and 14 so remarks on that also will be really great. I ...
2
votes
0answers
29 views

Physical simulation of diffusion-limited aggregates

The following code generates Diffusion Limited Aggregates on a two-dimensional square lattice. Some of the code has been omitted (e.g. support for differing lattice types and dimensions) for ...
4
votes
2answers
51 views

n-Queens backtracking code

I was learning backtracking algorithms earlier today, and was excited and wrote this code for n-Queens problem. Being my first try at backtracking algorithms, I would appreciate if you guys could chip ...
6
votes
2answers
114 views

Longest palindrome in an array

I am new to programming, and think this code could be improved upon. Any suggestions? ...
5
votes
3answers
245 views

Memory/performance of merge sort code

I wrote up merge sort code for some late night snack. I have gotten it working, but was just looking learn if I was missing anything in terms of efficiency. Could this code be significantly improved ...
3
votes
1answer
47 views

Mandelbrot image generator with parallel iteration

I'm currently trying to optimize this class I have for fractal generation. The equation is meant to be pluggable; I have used z => z*z + c so that it's not using ...