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)

-1
votes
2answers
31 views

Algorithm of combionations (problem with time and space)

my algorithm generates combinations of elements . For example having [A , B , C ] creates the following combinations [ A] , [ B ] , [ C ] , [ AB ] , [ AC ] , [ B , C ] , [ ABC ] . Unfortunately for ...
2
votes
1answer
20 views

Using goroutines to bruteforce a secret code

For a puzzle I had to brute force a password. I've never used goroutines before, and I don't have much experience in concurrency. This is the cksum function, which takes an array of the ASCII code ...
1
vote
1answer
25 views

Fast Event Manager

I've recently coded an event manager with performance as the main factor. I'd like to know what you think of it and what could be made better. ...
3
votes
5answers
167 views

Making ArrayList.containsAll run faster

Whenever using ArrayList, the method containsAll(collection) runs in time \$\mathcal{O}(mn)\$, where \$n\$ is the size of ...
1
vote
1answer
54 views

Sudoku verifier program

I implemented a Sudoku validation program. Can this be optimized even further in terms of performance? ...
4
votes
2answers
50 views

Hackerrank “Algorithmic Crush” problem hitting timeout errors

This is the Hackerrank problem Algorithmic Crush: You are given a list of size N, initialized with zeroes. You have to perform M operations on the list and output the maximum of final values of ...
12
votes
6answers
449 views

Storytelling program: Gathers stories from certain popular story websites/formats and reads them aloud

Audiobooks make my life easier when I have idle ears and a mind free to wander, but something better for my eyes to do. This program is one of my more recent efforts to allow most of the stories ...
4
votes
1answer
30 views

Long format data - fill episode based on conditional previous episode

The data are organised as long format data. 4 individuals are observed during 4 or 5 days (BCSID is the name of the unique key). Basically, the data describe ...
4
votes
3answers
126 views

Implementation of Sieve of Eratosthenes algorithm

I have made an implementation of Sieve of Eratosthenes algorithm in Java, and am not certain that it is as efficient as possible. I have looked at other peoples implementations on Google, and on this ...
4
votes
1answer
49 views

Create an object based on data from a text file

The following method reads specially formatted text (TOML) from a file and parses the input using a parser to get a few properties, which are then used to create an object. The profiler tells me that ...
3
votes
1answer
103 views

Reading, writing and filtering a CSV file

I have a CSV with 5+ million rows and I want to filter it: ...
1
vote
0answers
33 views

Web link parser that hunts for a specific string

This handles a parsing system to look at every users profile page and determine their job classification based on the class of a div element. I noticed that the class was always consistent on specific ...
5
votes
1answer
62 views

Longest Increasing Subsequence

I am learning dynamic programming and I have written down some code for longest increasing subsequence. I would like to know if there is any case or any area of improvement in the terms of ...
8
votes
4answers
560 views

Reorganizing inventory items into a data structure

I'm currently refactoring some old code of mine that I had done a few years ago, where it takes in two Lists to compare their contents, and then return the mapped contents that were matched. With 750 ...
7
votes
1answer
78 views
+100

IntModulus long addition and subtraction

One of the remarks in this answer to my question concerning IntModulus says What's more problematic is that you don't have matching argument symmetry for add ...
5
votes
0answers
117 views

Average movie rankings

Given a list of tuples of the form, (a, b, c), is there a more direct or optimized for calculating the average of all the c's ...
6
votes
2answers
98 views

IntModulus reloaded

As my question Modular arithmetic was hard to review and terribly long, I've added a few comments to the easier part, namely IntModulus. The code uses Guava and ...
4
votes
0answers
47 views

Blocking reads when writes are happening on two flows

I am trying to implement lock by which I want to avoid reads from happening whenever I am doing a write. My requirements are: Reads block until all three maps have been set for the first time. Now ...
3
votes
1answer
74 views

Converting a CSV file to a social network graph for Pajek

The code will ask for a directory and will then read the CSV file and then generate a file in that directory describing a social network for Pajek. Does anyone know a way to load this CSV file to a ...
4
votes
2answers
49 views

Linear cryptanalysis of a substitution permutation network

I was translating a script I had that would automate linear cryptanalysis of SP networks from Python to C++. For those who aren't familiar with cryptography, linear cryptanalysis involves finding ...
2
votes
0answers
47 views

Fast row-wise, parallel calculations on large, sparse matrix

I have a big (50k*150k) matrix with co-occurrences of nouns (rows) and adjectives (columns). As most nouns don't co-occurr with most adjectives, this matrix is very sparse, >99.9%, so I'm using the ...
2
votes
2answers
52 views

Calculate number of co-occurrences for two vectors

I would like to understand how to get rid of all the loops I am using in this code. I have a dataframe of 20 rows. I am simply counting the number of occurrences that the variables ...
1
vote
0answers
17 views

Range Query - Range Update

This is the problem statement: In most of the range query-update questions, we are asked to update some range of the array with some constant_value which can be ...
4
votes
1answer
72 views

C++ Trie Implementation

I recently tried a basic C++ implementation of a Trie, and was looking for some feedback on my code style/choices. In particular I was wondering if I'd made the right choice spitting the program up ...
2
votes
1answer
83 views

Ball Entity for a Entity/Component/System Soccer Game - Revision 1

I made some refactorings in my classes. The original code is in this question. In that question I receive the suggestion to create a Factory for the class BallEntity. I myself forgot that BallEntity ...
3
votes
2answers
61 views

Add two 4-D arrays in Python

I have two arrays, each with shape (1, 51, 150, 207) I need to add them such that: ...
6
votes
3answers
107 views

Extracting data from CSV file on the internet

This is my code I made that extracts data from a .csv file stored on the web. My sheet called 'New Data' stores this data for 2 days. I store 2 days worth of data so that when I run it next time, it ...
3
votes
2answers
62 views

Ball Entity for a Entity/Component/System Soccer Game

Here is a code snippet of a class that I be interested to refactor. I was in doubt on how to proceed with the process of instantiation. The original ask was here. After think about it and heard some ...
2
votes
0answers
45 views

Saving nested JSON to db, inferring order and record deletion

I've written a method for an API call that updates a store menu. It takes JSON as input, in the following format: ...
2
votes
1answer
49 views

Iterate through properties of an object

I need to round numeric values for properties of a given object. The following code works fine, but I am concerned if there is a way to make it faster. I am targeting latest Chrome and Firefox. ...
8
votes
4answers
861 views

Armstrong numbers in C

I have very little experience with C, so I decided to code a simple numerical program. An Armstrong number with \$N\$ digits is a number that is equal to the sum of its digits to the \$N^{th}\$ ...
3
votes
1answer
30 views

Implementation of KNN in R

I have implemented the K-Nearest Neighbor algorithm with Euclidean distance in R. It works fine but takes tremendously huge time than the library function (get.knn). Please point out the possibility ...
3
votes
1answer
63 views

Minimising the Triangle version 2

I asked this question and I have made enough changes, so I think it deserves a new question. The Problem: A triangle needs a good foundation. Every row in the triangle is derived from the sum of ...
4
votes
3answers
344 views

Parsing huge data coming from a URL

I need to parse the data coming from the URL which looks like this: ...
13
votes
2answers
230 views

Modular arithmetic

As the name says, LongModulus is a pretty long (lengthy) class implementing modular arithmetic for a long modulus. As overflow ...
5
votes
3answers
405 views

Is the list sorted?

Is the trade-off between simplicity and performance worth it? ...
4
votes
3answers
151 views

Writing a large file of numbers

Basically, I want to write a huge file of numbers. Each line in that file should contain one number. This program below is extremely slow (obviously) but it works. It writes one line after line and ...
0
votes
1answer
36 views

jQuery-loaded financial report taxes the browser

I load a table in a div using the .load() method. If I look on the console I see the times taken to display the table: 4.98 seconds that firebugs says are spent ...
3
votes
1answer
91 views

Stable reversed Tartaglia's triangles

Inspired by Minimising the triangle I am writing a fully tested program to solve the following problem: A triangle needs a good foundation. Every row in the triangle is derived from the sum of ...
2
votes
1answer
49 views

Project Euler 348: Sum of a square and a cube

Many numbers can be expressed as the sum of a square and a cube. Some of them in more than one way. Consider the palindromic numbers that can be expressed as the sum of a square and a cube, ...
4
votes
1answer
48 views

Adding proper validations on all the parameters coming from the URL in Rest Service

I am working on a RestService in which my URL will take lot of parameters. Below are the parameters my URL will take: UserId: ...
4
votes
5answers
221 views

Number of sub strings with same first and last character

Problem Statement: You are given a function \$f(x)\$, where \$f(x)\$ is \$1\$ if the first and last characters of string \$x\$ are equal; else it is \$0\$. You are given a string \$S\$ and you ...
2
votes
0answers
31 views

Performane issue for Matlab-like reshape in OpenCV

I am translating Matlab code to OpenCV. The code involves lots of reshaping of large matrices. As the Matlab reshape differs from OpenCV you can't just use OpenCV reshape. Here is why: Let's suppose ...
2
votes
1answer
74 views

Use DOM and XPath to make some changes in HTML document

I intend to make some changes in an HTML document, like remove, replace, append some nodes. I have several arrays with same structure like the following example ...
3
votes
2answers
67 views

Image processing routines for an image de-noising program

I have written a multi-language software to implement an image denoising algorithm (composed of many sub algorithms) called CANDLE. I have a C program that is part of the software and would like to ...
1
vote
0answers
33 views

PHP cron job for updating broadcast status

I am currently working on a re-occurring broadcast schedule. The whole idea is to setup a cron/task job that will update the broadcast flag "isLive" in a database table. Are there other options to ...
7
votes
3answers
173 views

Colorizing Excel cells with a date range filter

In a table there is a number of column (chambre) and a number of row (alveole). If these matches in a list in an other sheet then it checks if it the date is between two dates on that second sheets. ...
4
votes
2answers
213 views

Calculating how long sales reps are idle

I wrote a procedure to calculate the number of months elapsed since a sales agent' last sale. It works but runs in over 10 minutes... for 20 rows. ...
6
votes
1answer
109 views

Solving a partially completed 10x10 tournament schedule

My buddy schedules a dart tournament, and got into trouble when there were some scheduling conflicts. He has the first 3 weeks in the books, and needs to finish out the rest of the schedule. Turns out ...