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)

2
votes
0answers
11 views

Replacing accented letters with regular letters in a spreadsheet

I am using the following VBA code to replace accented letters with regular letters in a spreadsheet. This is necessary because these spreadsheets have to be uploaded to an import tool that does not ...
2
votes
0answers
17 views

Excel VBA highlighting macro

I have this Excel macro I created to highlight all instances of a number if at least one instance is already highlighted before running the macro. ...
1
vote
1answer
48 views

C# Encryption algorithm

I am using CTR mode (it is a cipher in itself) in this code below. I just wanted to see what you guys thought about it before I finish it. (Yes, I know that the plaintext length and key length must ...
2
votes
1answer
29 views

Word Wrapping and Boxing

This was an experiment to take any text and wrap it to a given number of columns. It also wraps the text in just one box, lets you box multiple blocks of text, and also lets you limit the number of ...
4
votes
0answers
37 views

Circular Buffer in C - Follow Up

This is a follow up to this post I uploaded a few days back on my alternative account about a circular buffer in C. I'm confident that I fixed most of the warnings and even added an iterator. ...
3
votes
2answers
48 views

Filtering numeric vectors by proximity to any elements of another vector in R

I frequently want to filter and select elements from a long vector in R. Often, this vector is a column in a data.frame. I am usually interested in rows of the ...
0
votes
1answer
25 views

Laravel bulk insert optimization

I'm currently using a make shift INSERT on DUPLICATE UPDATE function that relies on a DB raw query from eloquent. I'm looking to improve the quality of the code and the speed. Please take a look ...
2
votes
2answers
27 views

Sending an SMS message using zenoss and python

I have just finished a simple python script which uses this module to call Zenoss API for getting live events. What the script does: connects to zenoss reads a file which has one phone number on ...
0
votes
2answers
36 views

Notify owner of post and other commenters

I have a rails4 app. When a user comments on a post it should send a notification to all the guys who commented on the post and to the post creator. I have a working method in the controller, but it's ...
2
votes
1answer
45 views
3
votes
1answer
52 views

Explosion animation plugin for a game

I have been writing a small particle plugin since I want to learn how physics works for games. Now I have tried to get this as clean as I possible could but It feels something is missing. Am I ...
1
vote
0answers
67 views

Submitting a JSON [on hold]

I have service to which I have to submit a JSON but I have to send the JSON multiple times and the code is slow. How can I improve the performance? ...
1
vote
1answer
33 views

Angular console like window - first directive

I've asked question on SO how to rewrite jQuery code to Angular. Because I got no answers I've tried to create something by my own. This is my version of code: ...
4
votes
1answer
68 views

Recursive Breadth First Search for Knights Tour

This was written as an experiment in performance, based on another question here on CodeReview. Input into the algorithm is the number of squares on one edge of the chess board, the point of origin, ...
2
votes
0answers
17 views

Memcached load generation

I have this code in python 2.7, it is working but right now it is not giving me the throughput that I want. The main function has the load generation loop (where it is putting work in Queue). I am ...
0
votes
1answer
20 views

Improving the running time of finding the count of pairs satisfying a symmetric relation

I had an online coding test yesterday. The question is not hard to solve, but I could not achieve the required running time. The question is as follow: Given \$1 <= M\$, \$N <= 10^5\$ find the ...
5
votes
1answer
53 views

Equivalent passwords ACPC 2014

I am preparing for ACM-TCPC (Tunisia). So I started solving problems from past ACM-ACPC versions. But I got stuck in the Problem I from 2014. The problem consists of finding the number of ...
3
votes
2answers
38 views

Generic Vector Implementation

I'm in the process of writing a Generic Container Library in C called CGCL (https://github.com/ta5578/C-Generic-Container-Library). One of the generic containers I'm implementing is the vector ...
0
votes
1answer
20 views

SICP - exercise 1.12 - pascal's triangle

From SICP: Exercise 1.12: The following pattern of numbers is called Pascal’s triangle. 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 . . . The numbers at the ...
1
vote
2answers
656 views

Which is correct : Open one Connection for inserting List of objects or open connection for every single insertion?

I have written the following method twice but I don't know which is better from performance perspective, code design and best practice. First: ...
-1
votes
0answers
36 views

Mulptiple if statements vs logical operator

I'm hooking a certain game function, and I'm curious if multiple if statements are faster than the logical or operator. ...
3
votes
1answer
41 views

Clojure reverse multiple times

I have a piece of Clojure code that reverses a string recursively. It is working but too slow (because I got the problem from Codewars and I cannot validate it ...
0
votes
0answers
13 views

External / File-based mergesort (what is MAPPEDSHIFT, MAPPEDMASK, MAPPEDSIZE?) [closed]

I am currently working on a file-based merge-sort implementation and found the topic "External / File-based mergesort" in this forum. Link: External / File-based mergesort I tried to run the code ...
2
votes
1answer
57 views

Find all distinct subsets that sum to a given number

The function wants to achieve to find all distinct subsets that sum up to an given number. ...
1
vote
1answer
27 views

Quickly find percentile with high precision

I need to find the percentile where a list of values is higher than a threshold. I am doing this in the context of optimization, so it important that the answer is precise. I am also trying to ...
1
vote
0answers
47 views

lock-free list performance

I tried to write a lock-free list in c++ unfortunately the performance compared to a std::list secured with a simple mutex is bad what do you think? Are there major performance or code-style issues? ...
3
votes
2answers
189 views

Edit method, optimizing and minimizing method to reduce complexity

Yesterday I had posted a question regarding optimizing editMethod here on code-review. Thanks to an awesome answer by Pimgd, I was able to merge conditional checks, checking conditions and few other ...
5
votes
1answer
43 views

Dice roll program with statistics

This is a working program I made to roll dice a specified number of times, show how many times each number (2-12) occurred, and the percentage of the total rolls that each number got. I'm trying to ...
6
votes
3answers
80 views

Circular Buffer

For my current project I need a circular buffer, which is able to do the following things: Push something to it (to the head). Pop something from it (from the tail). I don't need the popped data. ...
4
votes
2answers
285 views

Getting all possible letter combinations of a word

I wrote a simple algorithm for finding all possible letter combinations of a single word. I want to know if my code can be improved in any way, although I'm mostly interested in efficiency. You can ...
5
votes
1answer
107 views

Edit method, doing multiple checks for tracking changes vs the one in database

I am working on a Spring-MVC application in which there are around 2-3 methods which are quite big and complex, but only one of them worries me, especially for maintenance or changes. As changes in ...
1
vote
1answer
101 views

Calculating all possible Knight turns (Chess)

I'm creating a console application that takes as input starting column and starting row, also the ending column and the ending row and it's going to output all the possible way's to get to that point ...
3
votes
3answers
94 views

An assignment algorithm in C

As a post processing step of a similarity matrix computation that leads to the non-negative matrix mt4_ in gpu, I am performing an assignment step to determine ...
4
votes
3answers
216 views

Deleting rows based on a date

I am deleting rows based on a date. I am loading the entire sheet into an array and doing the evaluation and building a string containing the rows I want to delete. ...
4
votes
1answer
43 views

Java NIO server Selector loop

I have a server that uses Java NIO in non-blocking mode. Right now I'm using a single thread for the selector, and four worker threads to process the bytes after ...
5
votes
1answer
53 views

SlidingNumberTile Program Efficiency

I created a Sliding Number Tile Game, and am looking for input on how to make the code better organized & more efficient. ...
4
votes
2answers
157 views

Multiprocess, multithreaded read write on a single file

I've got a job to create a library that would be able to support multithreaded and multi process read and write to a single file. On that single file we would store C# models in an array in JSON ...
1
vote
0answers
44 views

Priority message sending

We have created a message queue system using priority messages. The idea behind this code is as follows: We have a list of clients. All clients know if (and what kind of priority) messages they have ...
2
votes
0answers
78 views

Number-to-words translator

I've created a class that translates an integer into words in an English (not British) format. My first human language is not English, and I don't have a good idea of a truly right way to read ...
2
votes
1answer
37 views

Nested loops - Random Forest, multiple parameters

I'm writing a code which task is to grow Random Forest trees based on multiple parameters. In short: Firstly, I declare a data frame in which model parameters and some stats will be saved. Secondly, ...
2
votes
1answer
45 views
0
votes
0answers
36 views

Distinct List of attribute values from XML, using a pre-defined set of attribute names

I have an XML stream that looks like the following (attribute and node quantity , and node depth reduced for demonstration purposes.) ...
3
votes
2answers
83 views

Reading file into structure

At the time I'm trying to read a quite big file into a C program for later user. The file size is in the range of 800 megabytes containing around 20 million lines of data of the following format: ...
3
votes
1answer
29 views

Putting a matrix from a text file into a list

I'm trying to read a text file with matrix and put it in a list, but I am using two loops here and I want my function to be faster. ...
0
votes
0answers
10 views

Improving the performance of web scraper using BeautifulSoup

I am using python3 with Beautiful Soup to scrape web site, I also used Thread to download images, but it will spend more than 30 minutes to get all information and download relevant images, how can I ...
3
votes
1answer
54 views

Josephus permutation - follow up

Follow up of this question Changes: The pop_min function now panics if the tree is empty. Moved the size attribute to the ...
10
votes
4answers
122 views

n-queens puzzle in Python

I want to increase the efficiency and reduce the time complexity for the n-queen problem in n*n matrix chess. I am able to run only still (11*11) in normal time otherwise for the big number it is ...
4
votes
1answer
122 views

Finding the longest path, avoiding obstacles in a 2D plane

The Scenario You are given a matrix of size m x n (width x height) with m*n spots where there are a few obstacles. Spots with obstacles are marked as 1, and those without are marked as 0. You can ...
4
votes
1answer
74 views

Josephus permutation

This problem is taken from the book Introduction to Algorithms, Third Edition By Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein: We define the Josephus problem as ...
4
votes
0answers
43 views

Shortest path navigation across a grid using Best First Search

The code below is an implementation of the Best First Search algorithm for navigation of the shortest path across a 2D NxN matrix. As a heuristic for the search I use the standard distance formula. ...