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)

2
votes
0answers
13 views

Can you see any improvements my jQuery boilerplate?

I'm working on my library. I want to Maintaniable, Performance, Speed codes and quickly starts any projects. Its just a boilerplate, wrap some script code, helper functions, some plugin ...
1
vote
0answers
12 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
30 views

Optimizing game camera

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

Iterated root-finding and optimization with python

I am quite new to Python and I have trouble finding the roots of a function. First a bit on what I want to do. The ultimate goal is to find $$y=(a_1,p_0,\theta)$$ such that they minimize the function ...
5
votes
3answers
53 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
638 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
46 views

Solver for Jumble puzzle

Here is my first attempt to solve Jumble puzzle: ...
2
votes
2answers
40 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
22 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
155 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 ...
3
votes
3answers
37 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
49 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 [on hold]

ANy ideas how to improve this code? //productPath arrives ...
2
votes
0answers
34 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
129 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
47 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: ...
-3
votes
0answers
90 views

What is the fastest way to make sure a post action results in a database addition? [closed]

I am trying to understand the performance of my mobile service in Azure but it is not entirely clear to me how I can improve the performance. The idea behind the following code is that an API call ...
2
votes
1answer
29 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
371 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
37 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
180 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
71 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
541 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
51 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 ...
3
votes
2answers
51 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
96 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
54 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 ...
3
votes
2answers
81 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
54 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 ...
5
votes
1answer
53 views

Removing all stopwords from a list of words

What is the fastest Pythonic way to remove all stopwords from a list of words in a document? Right now I am using a list comprehension that contains a for loop. ...
2
votes
2answers
64 views

Computation of population patterns in simple agent-based model

I've modeled the population changes for a group of agents that inhabit a 2D lattice (with wrapped boundaries) made up of M x M number of grids. At each time step: ...
2
votes
2answers
26 views

Generating random XML documents

I'm trying to generate a fresh XML file using Perl XML::Mini::Document. The sample code i tried is the one below. It's working fine, but I don't know whether it's ...
8
votes
2answers
159 views

Approximate (250 over 100) permutation best fitting certain criteria

Given a list of 250 words of 4 letters each, what is the fastest way, in Python, to find a subsample of 100 words (drawn without replacement) so that the distribution of letters across the whole ...
10
votes
3answers
1k views

Bejeweled game - performance and code redundancy

I'm fairly new to Java and tried to recreate a Bejeweled game, what I've coded so far works as intended, but I'm not sure if my approach is smart. I set up the ...
0
votes
0answers
49 views

Reduce a string using grammar-like rules

I've got a program in Java which simplifies input string using grammar-like rules. Length of string is up to 200 and number of rules is up to 300. In big cases it works too slow, so I need some advice ...
1
vote
2answers
41 views

Neatly printing integers interspersed with spaces - follow-up

See the previous iteration. At this point, I have "digit group" length assumed to be always 3 the user can pass the delimiter character of his/her own handles (seems to handle) the minus sign ...
2
votes
1answer
71 views

SFML Pong Game Performance

I was hoping I could get some feedback on performance of my animations overall. It could just be me but I keep getting a bit of lag despite being at 60FPS constantly. Objects on screen seem to tear a ...
3
votes
3answers
144 views

Speed up large calculation of intersections

I have the following data: trains is a dictionary with 1700 elements. The keys are the IDs of trains and the value for each train is an array with every station ...
1
vote
2answers
79 views

Dictionary foreach loop with multiple occurences

A little look on what are Dictionaries: dictWordCounter<string, int> dictWordPercent<string, double> topTwentySeven<string, double> ...
0
votes
1answer
55 views

Reading WLAN packets

The script reads WLAN packets, looks for probe requests and then extracts SSID, MAC address and then stores them in a list if the MAC address/SSID combo is unique. ...
0
votes
1answer
25 views

Shortest path algorithm in 0-1-unoriented graph

I have an unoriented graph with n vertices and m edges, 1 <= n, m <= 100000. All edges ...
4
votes
0answers
53 views

Scraping scores from flashscore.com

I built a bot with Python to scrap scores on flashscore.com but the data scrap from the site loads into its listbox very slowly. I am curious about the speed of selenium so I made a button that prints ...
1
vote
1answer
32 views

Performance of summing one value from join of three tables

I have a table I want to get a sum of information on, but the value I need to query on is in two different tables. The one with values I need to sum is say, kudos, which has a value indicating +1 ...
3
votes
2answers
84 views

Epilogue to a binary search to find the range of matching indexes

I am trying to find out the best practice for writing a loop which does one check and at the same time has to increment a value so that the while loop will ...
2
votes
1answer
33 views

A1Notation conversion to row & column index

This set of Google Apps Script helper functions are published in this gist, along with a bunch of other utilities. Background info is in this SO question. Since no Google services are used, this is ...
0
votes
1answer
27 views

Matlab to C++ percentile clipping

I have a 2D matrix in Matlab and I want to convert the Matlab code into C++. In C++ I have int* channel_gr. The commented code is the original Matlab code. Is ...