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

0
votes
0answers
3 views

performance optimization - phonelist code too slow

I've been going at this challenge to learn haskell but my code is way too slow. I am really new to haskell so I don't know what to look for in performance optimization. I have generated a sample ...
2
votes
0answers
8 views

Crawling 2D Maze/Matrix

I'm trying to create a class that's able to 'crawl' through a generic 2D matrix. Crawling through a Bitmap (which can be viewed as a 2D Matrix of Colors) should yield the same result of a flood fill. ...
-2
votes
0answers
25 views

java for loop optimization [on hold]

I have the following question. Is there difference between 2 variants or java optimizer optimizes the second variant to first 1. ...
-1
votes
0answers
26 views

Suffix array construction in O(n (logn) ^2)

I wrote code for suffix array creation based in \$O(n (log n)^2)\$ on the tutorial in CodeChef. My code gets TLE on SPOJ and I'm not sure why it is not performing in \$O(n^2 log n)\$. ...
1
vote
1answer
40 views

Sum of primes between two number from optimized Sieve of Eratosthenes

Here is the code that I wrote to give me sum of prime numbers between n and m: ...
8
votes
4answers
530 views

Checking if a point is on screen

I'm working on a tile-based game, and am looking to improve the efficiency of my code to slightly improve framerate. I call this method on every tile, every frame, so it is very performance critical. ...
3
votes
1answer
29 views

Concatenating CSV filenames into a single file

I've created a PHP script which take an array of filenames as a comma-separated parameter and concatenates them, serving them as one, single JavaScript file. I've also built a caching mechanism into ...
-5
votes
0answers
59 views

Optimization of matrix and loops [on hold]

This function works and am only looking for ideas on how to make it faster. Basically this function is a multidimensional search. These arrays can be huge but the resulting Matrix is usually sparse. ...
3
votes
1answer
31 views

Local report RDLC to PDF

Is there any way to improve the performance of local report or even an alternative if not? I have been looking for a solution for quite some time but the general consensus seems to be that it's just ...
1
vote
2answers
71 views

Project Euler problem 23 - non-abundant sums

I present my solution for Project Euler problem 23 written in Python (2.7). The problem statement is: A perfect number is a number for which the sum of its proper divisors is exactly equal to ...
2
votes
0answers
27 views

HTML5 canvas drawing from video source

I have the following code, which draws a overlay image onto video for each frame: ...
3
votes
2answers
189 views

HackerEarth Girlfriend's Demand challenge, solved two ways

I solved the Girlfriend's Demand challenge on HackerEarth. In summary: Input: First line of the input contains a string S. Next line contains an integer Q, the number of queries. Each of the ...
2
votes
1answer
42 views

Generic Graph Abstract Data Type Implementation in C++

Today I tried to code up a generic graph abstract data type in C++. Precisely, I implemented the adjacency list data structure for a generic graph type. I think it seems to work with different type ...
3
votes
5answers
234 views

Checking if all the characters from an A-Z is present in the string

A string is said to be complete if it contains all the characters from a to z. Given a string, check if it complete or not. Input First line of the input ...
8
votes
4answers
376 views

BFS search function

By profiling my application, I found that the bottleneck of my application is the function below. In particular it will be executed by a lot of entities (monsters) in a game, that will go onto a ...
1
vote
1answer
33 views

Net health monitoring

This is a little net health monitoring project I made in NodeJS. It pings google every second and stores the result (true/false) along with the date in a database (MongoDB). I've collected enough ...
15
votes
2answers
978 views

Can I buff up your file?

Here I have a method for reading the contents of a file into a buffer and returning whether or not it is successful. Here is what I would like reviewed: Speed: Am I reading in the file as fast as ...
4
votes
1answer
61 views

HND Java module (vending machine simulator)

As part of the distinction requirement, I am required to ask for testing/review of my code. There was no time allotted for this in class, and as such I am turning to the folks of StackExchange for ...
2
votes
0answers
41 views

jQuery boilerplate library

I'm working on my library. It's just a boilerplate, wrapping some script code, with helper functions, some plugin implementation, required meta tags etc. How can I develop this better? ...
2
votes
0answers
27 views

Using Nokogiri to scrape Oscars winners from Wikipedia

I am scraping a Wikipedia page, getting info from that page and instantiating a new object with the information collected: ...
-1
votes
0answers
15 views

Kth selection routine - Floyd Algorithm 489 [migrated]

I have recently come across a promising Kth selection routine that reportedly outperforms quickselect the Floyd, Rivest Select routine. This Wikipedia article provides a pseudocode version which I ...
1
vote
1answer
35 views

Optimizing game camera

I'm moving some octagons around and I found a serious bottleneck: ...
1
vote
0answers
44 views

Iterated root-finding and optimization

I am quite new to Python and I have trouble finding the roots of a function. The ultimate goal is to find $$y=(a_1,p_0,\theta)$$ such that they minimize the function $$-\sum\limits_{j=1}^{n} ...
5
votes
3answers
75 views

Adding Reversed Numbers - ADDREV on SPOJ

Today I tried solving this problem on SPOJ, in which you reverse the digits of two numbers, add them, and print the reversed digits of the sum. (When reversing, leading zeroes in the result should be ...
14
votes
5answers
679 views

Mandelbrot image generator

I have written a C program to generate a PPM (Portable Pixmap) image of the Mandelbrot set. The program implements many things in C I am fairly unfamiliar with (Structures, error handling, use of new ...
4
votes
2answers
51 views

Solver for Jumble puzzle

Here is my first attempt to solve Jumble puzzle: ...
2
votes
2answers
41 views

Effecient Use Sieve of Eratosthenes algorithm

Given this as a the Problem Statement Given two numbers, find the sum of prime numbers between them, both inclusive. Input: The first line contains the number of test cases T. Each ...
2
votes
0answers
31 views

Extensible actions for same element

In order to avoid boilerplate code and make an extensible pool of actions for the same portion of code (a row of texts to edit), I've prepared this code. ...
3
votes
2answers
258 views

“Find the number” puzzle

A friend gave this puzzle: Find 3 numbers (say, A B C) such that \$ABC+ABC+ABC = CCC\$ ABC means \$((A*100) + (B*10) + C)\$. Also, these 3 digits must be distinct. I wrote a quick code to find ...
4
votes
3answers
44 views

Checking dates against a .properties file

I am writing a script that will check the set values against a .properties file and I am just wondering if there is any nicer way to write what I have here. ...
6
votes
1answer
53 views

Listing payments where all payments lines and transactions are closed

The goal of this query is to get a list of payments where all the corresponding payment lines and transactions have the status CLOSED. These are one to many relationships. The database is Informix. I ...
-1
votes
0answers
44 views

Refactor if else in function [closed]

ANy ideas how to improve this code? //productPath arrives ...
2
votes
0answers
43 views

Java JSON Stringifier with the Nashorn API

I have written a Java JSON stringifier with the Nashorn API. Since this code is slow, I wanted to ask if I can improve it. My target is the highest possible performance to make it an alternative to ...
2
votes
2answers
46 views

Python Command Line Rock Paper Scissors

I'm looking for tips on how to clean up this code and/or make it more efficient. Keep in mind I am a seriously new programmer and if it is too advanced it's likely to go over my head. ...
2
votes
3answers
133 views

Thread-safe Iterator wrapper

Aside: This code assumes a class Option that can be Some or None to represent the presence (Some) or absence (None) of the value it contains. Haskell calls it Maybe. Here is my first pass at ...
0
votes
1answer
48 views

Repetitive code for a projected field in a lambda

I have a simple projection in my code. Taking away the majority of the fields which are not of interest, it looks like the following: ...
2
votes
1answer
31 views

Generating combinations of n elements in groups of k

I've written this program that writes all the combinations (without repetition) of n elements in groups of k. I think the code is good, but I like to know if you have some better (or faster) ...
9
votes
5answers
1k views

Finding the smallest number whose digits sum to N

I tried my hand at a grade XII Board exam program: Given two positive numbers M and N, such that M is between 100 and 10000 and N is less than 100, find the smallest integer that is greater than M ...
3
votes
4answers
379 views

Educational website using ASP.NET webforms

Our team is developing an educational website using ASP.NET webforms. We designed DAL & BAL classes and now I have some questions: Are DAL & BAL designed well? Would it be better using ORM ...
2
votes
0answers
40 views

Parallelized image transformations using GraphicsMagick

This is part of a script that I use for porting a TWRP Theme from one resolution to another. Respectively portrait to portrait and landscape to landscape. In this function entirely, it focuses on the ...
10
votes
5answers
195 views

Word frequency in a large text file

I've am trying to read a large text file and output the distinct words in it along with it's count. I've tried a couple of attempts so far, and this is by far the fastest solution I have come up with. ...
8
votes
1answer
73 views

Drawing circles with triangles

As pyglet has no in-built method to return a vertex list of circle, I had to build one myself. This is a critical piece of code that I will use very frequently. I need it to be of very fine ...
7
votes
4answers
553 views

Calculating the factorial of a number efficiently

I was trying to calculate the factorial of a large number in a short time: ...
6
votes
2answers
54 views

JMH Benchmark Metrics Evaluation

I'm currently attempting to learn some basic JVM optimization techniques using JMH. I created the following bench to compare mid-index insertion performance between ...
4
votes
2answers
56 views

Counting occurrences of a character in a string

Scenario "The Semantic Mind-Reader!" browser known as jhool is known as mind-reader for a reason. Here's why: You don't need to type 'www.' to open a website anymore. Though, you still ...
5
votes
3answers
98 views

Finding the Nth prime

I'm going through some of the problems over on exercism and we were asked to write a program that finds the nth prime. I know Ruby has a Prime class that handles that but the exercise doesn't allow us ...
3
votes
2answers
56 views

Split function while reading multiple lines

The input begins with the number \$t\$ of test cases in a single line (\$t \le 10\$). In each of the next t lines there are two or more numbers \$m\$ and \$n\$ (\$1 \le m \le n \le ...
4
votes
2answers
88 views

Sudoku solver using forward checking

I was compelled to look into a Sudoku Solver in Java using the principles I have learned in a course, namely I wanted to make something that included backtracking and forward checking. Has anybody ...
7
votes
4answers
260 views

Extracting and cleaning up duplicate emails

Right now I am using a regex to extract emails from a text document, and filter the duplicates out of this using the Distinct function from linq. After which I run the output file through a clean up ...
6
votes
1answer
55 views

Finding the bounding box of a polygon array

I have a Polygon array, and I need to get a Rectangle object which bounds all of the polygons inside the array. Think convex ...