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 (3)

0
votes
1answer
12 views

Initializing a namespace tree

I have a global namespace where developers attach object singletons, class definitions, constants, etc. Each JS file has its own crafty flavor of namespace tree initialization. Maybe a module pattern ...
5
votes
0answers
39 views

Efficiently checking if a large enumeration has a consistent order

The scenario is as follows: We have a streamed enumeration that we have to check if it's ordered or not before processing it (about 75-80% of the time it is ordered). We are talking about pretty big ...
1
vote
1answer
30 views

Adjusting the height of a div to match that of another column

This code checks whether an image whose parent is .papers.left has completely loaded into DOM and if yes then the background of ...
2
votes
2answers
51 views

Rotate and translate a 2D point N times

This is a C++ program that rotates a point initially located at origin by a given angle A (degree) counterclockwise and L translate its x-coordinate (sum L to it). Here is my program: Firstly it ...
1
vote
0answers
25 views

XML/HTML batch generator

As part of an exercise I've written some code to generate multiple HTML files based on information stored in a couple of XML files. I'm not really sure how much code you'd need to evaluate my function ...
4
votes
0answers
52 views

Learning OpenMP+MPI: Feedback and comments on Gauss-Seidel+SOR

I am learning OpenMP+MPI hybrid programming. As an example I have chosen Gauss-Seidel+SOR. My implementation uses MPI_THREAD_FUNNELED style hybrid programming, ...
3
votes
1answer
88 views

Project Euler #14: Longest Collatz sequence

Problem : source Which starting number, under one million, produces the longest chain? n → n/2 (n is even) n → 3n + 1 (n is odd) I want to receive advice on my code. It is too slow... It ...
1
vote
0answers
11 views

Get similar posts with manyToMany relationship: Make faster

I have table 'post' with manyToMany relationship to 'tag' and 'product' tables. post <---> tag post <---> product For example, if I have post, I can get similar posts similar by tags and ...
3
votes
0answers
30 views

Multiple many-to-many filter with range using filteriffic

I should say that the code I have works. I feel like there has to be a much more efficient way to do it (especially when I just crashed my server with it). Relevant schema: ...
2
votes
0answers
48 views

Greyscale converter performance in Swift

I have a single class which converts an image's colors into greyscale (except one given color, which will be left as it was before): ...
6
votes
2answers
91 views

Random Word Splitter

I wrote a word splitting function. It splits a word into random characters. For example if input is 'runtime' one of each below output possible: ...
1
vote
0answers
38 views

Optimizing R + ROracle performance

For my internship I have to perform certain analysis to determine residuals and outliers. The table I'm currently using has over 12 million records with 130+ columns. My first tests take approx. 5398 ...
10
votes
2answers
259 views

Unique value finder

For our first assignment in our algorithm class we are suppose to solve several different questions using information from a 2D array. We are also suppose to optimize our code to get more marks on our ...
4
votes
3answers
115 views

Calculating the distance between two letters

I completed a sample programming challenge and wanted to find out how I could make it more efficient. I'm trying to get better at writing more efficient code, so I would be interested in hearing ideas ...
3
votes
1answer
85 views

Re-implementing memcpy

I have written an implementation of memcpy function and I want to know how good is it and if it gets the most out of the processor capabilities or not. The reason ...
1
vote
1answer
34 views

Character class for an RPG game

I have an RPG-like program that uses a Character class to specify and return information about an individual player/character. I was curious about a way to best set ...
4
votes
0answers
32 views

Grid with images in RecyclerView

I've created a Grid with a RecyclerView similar to the GoogleIO 2014's generic media player one. GoogleIO generic music player Mine The thing is that the ...
1
vote
0answers
17 views

Util method for generating an INSERT sql dynamically

I'm currently building software that: 'talks' to Google Analytics API, fetches data, persists the data to a MySql db. Insertion of data into the db needs to happen automatically - based on the ...
1
vote
0answers
61 views

Red-Black Tree (2-3-4 node tree) map implementation

Here is an implementation of a red black tree that I made. I am pretty sure it's working fine though I may have overlook something. How can I improve it in any way possible? Interface: ...
3
votes
1answer
36 views

Reading headerless image style and performance

This code is working and was tested for over 10000 images. I have many headerless images, i.e images which are binary files with known dimensions. Some of the images have a visible area which is ...
1
vote
1answer
28 views

Check that an image is available to be served

I have a couple of images in my database and I need to check if the images are still good or if they're deleted or corrupted. I came up with a solution but it's very slow. I was wondering if there was ...
4
votes
3answers
131 views

Extracting a database name from a file

I am developing a project that converts SQL server file to MySQL file based on some assumptions. I have written a function that takes the string source as input and it extracts the database name. Is ...
1
vote
0answers
33 views

Update operation with hibernate

I am creating a project about hotel reservations. I created a udirection one to many relationship between users and reservations. That is, A user can have many reservations. Here is the User class. ...
3
votes
4answers
93 views

Project Euler #8 - Largest product in series

The problem The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. ...
5
votes
3answers
62 views

Cryptoanalysis of Vigenere-ciphered text with Kasiski test

I am creating a program that will analyse encrypted text using Kasiski examination in order to find possible key length: ...
2
votes
1answer
35 views

Performance improvement on vb.net code

I need to write 5 crores records with 72 columns into text file, the file size is growing as 9.7gb . I need to check each and every columm length need to format as according to the length as defined ...
3
votes
0answers
64 views

Canvas animation of network nodes and edges

Having to give the idea of an ever changing network of nodes (each with different impact and possibly more than one color) connecting each other to create something. I wanted to give it depth ...
4
votes
4answers
200 views

Hacker Rank - Poisonous Plants

I have the solution for the problem, but it is taking me 7 seconds to run on a large dataset. I am trying figure out a better way of doing this. It has to run in under 3 seconds. Problem Statement: ...
6
votes
2answers
88 views

Using BubbleSort to sort numbers into ascending & descending order

I have created a simple implementation of the bubble sort algorithm. I have tried to make it as efficient as possible by following pseudocode which I have provided below, making some slight ...
3
votes
3answers
150 views

Storing and processing large arrays to compute dot products

Problem Statement (from HackerRank) We have two arrays \$a\$ and \$b\$ of length \$N\$, initially all values equals to zero. We have \$Q\$ operations. Let's define three types of operations on ...
2
votes
0answers
33 views

Non-recursive permutations and strings generator

Inspired by Sam's question (Brute-force string generator) and rolfl's really short version of the algorithm I started to experiment with a different approach and created one that seems to run a little ...
9
votes
3answers
406 views

Computing the n-th prime

I've written some Python 3 code that computes the \$n\$-th prime. I implemented first a naive isprime function that looks for divisors of \$m\$ between \$2\$ and \$\lfloor \sqrt m \rfloor+1\$. Then a ...
6
votes
2answers
131 views

Fastest C++ code to get common prefix length

In a C++ program, I have the following function to find the length of the longest common prefix between to char arrays a and b. ...
6
votes
0answers
49 views

Improving performance in unique-ifying an image

I'm writing a program that takes an input image, and generates a set of unique colors, and repaints the image using only those colors. It takes a long time, and I'm hoping to improve the running time. ...
4
votes
1answer
58 views

Vigenère cipher 2

The following program is an updated version of this question, an implementation of the Vigenere cipher in C. It has been updated to take input from stdin and pipes, ...
6
votes
1answer
49 views

Haskell Ackermann function

I had a challenge a while back from a friend to try and produce the fastest possible program to compute A(3,16), where A is the ...
5
votes
1answer
33 views

Sieve of Eratosthenes in Python 3

Currently, the code will generate a range of natural numbers from 1 to N and store it in a list. Then the program will iterate through that list, marking each multiple of a prime as 0 and storing ...
6
votes
1answer
69 views

Sieve of Eratosthenes for prime generation

I was originally going to write this intro as just being the bare-bones "here's my problem, here are some ideas, what do you recommend" format (which I am still going to follow, mind you), but I've ...
3
votes
2answers
19 views

Generating, segregating, merging, and sorting random numbers

I've been working on this elevator program for quite some time now and finally finished it and made it work and I'm pretty proud of myself, but I'd like to see ways how to optimize my code so I can ...
8
votes
1answer
136 views

Tuple<int, int> replacement

I use the following structure in a web service where performance is critical. It is used for making joins between domain data objects, the key is made of two integers. The idea is to fit the two 32 ...
0
votes
0answers
36 views

Permutation and sorting of Strings (parentheses problem similarity)

This algorithm runs in \$O(n!)\$ time and I wish I could make this a bit faster for larger elements. Is there a better approach to solving the parentheses problem in shorter time? ...
11
votes
1answer
92 views

2D Gravity Simulator-like game

This project is pretty much like a 2D gravity simulator. You click and it creates a circle that attracts other circles. The result of a collision is a bigger circle that is a sum of the masses. If you ...
5
votes
2answers
223 views

Prime factorization for integers with up to 9-digit long prime factors

I've become interested prime factorization since solving Project Euler problem 3 (finding the largest prime factor of 600851475143). Learning here that initializing lists with many elements to later ...
3
votes
2answers
28 views

Splitting large text file and sorting by content

I have a large text file (~2GB) full of data. The data (sample below) gives an x, y, z coordinate, and a corresponding result on each line (there is other stuff but I don't care about it). The single ...
-1
votes
0answers
40 views

Updating fields in a MySQL database

I had to update the question ID of an answer table according to some condition. I have written the following script but it takes more than 700 seconds to execute because the data is huge. ...
10
votes
2answers
242 views

Filtering log files from a server

I have made a program in Python to do a filter of log files from a server. What I would like is some guidance on how this code could be optimized, streamlined or 'short-handed' so my 'pythonic' ...
4
votes
1answer
33 views

JavaScript Canvas Animation

This animation makes my fans spin up after several seconds, and it seems to have a sub-par framerate. I am trying to understand why, and optimize its performance. Codepen The animation function ...
10
votes
1answer
99 views

Calculate the area of rectangles union

I've been given the following task: Given N rectangles with edges parallel to axis, calculate the area of the union of all rectangles. The input and output are files specified in program ...
11
votes
1answer
125 views

Mandelbrot Streams

A recent Mandelbrot question (Hi @EBrown) in C# inspired me to build my own using the Java 8 parallel streams to implement the parallelism that's useful for computing each pixel value. The intention ...
3
votes
2answers
120 views

Count words that are longer than a set Length

This is working, but I want to know if is this a place where IEnumerable can be used? ...