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)

1
vote
0answers
12 views

1D shock tube problem written in Fortran

I have written a simple Euler solver for the 1D shock tube problem. Eventually, I plan to extend this code to solve the full 3D compressible Navier-Stokes equations. Therefore, I want to start with ...
5
votes
4answers
683 views

Fast Number Factorization in Python

Here's my implementation to factorize a positive integer: ...
4
votes
2answers
31 views

Storing disassembled data in a structured way

I want to store the information returned by the dis function of the dis module in a structured way, using a dict, associating the mnemonics of each code of a line to the correspondent line number. ...
2
votes
1answer
47 views

My spaceship is slow to explode after being hit by the asteroid

I am making a game for my computer science class. And my professor's requirements is: Write a Processing program that draws a triangle in the middle of the window. Rotate the triangle when the left ...
3
votes
2answers
309 views

Web dashboard using many REST API requests

I have created REST API in codeigniter. REST sever created in codeigniter 3.0 and REST client created codeigniter 2.x.x. I have wrote simple code for login. After login client created dashboard ...
1
vote
2answers
63 views

Concatenate three 16-bit integers in one 64-bit integer with C++

I am looking for an elegant alternative of the following code where wordXX contains always 16 bits: ...
5
votes
2answers
342 views

Beginner word-guessing game

I have the following code. Aim is to guess a four letter string. Each letter can be tried four times. If the letter cannot be guessed, we go to the next letter until the fourth letter is reached. I ...
3
votes
1answer
45 views

Multiplying square matrix with C pthreads (POSIX threads)

I'm a student, and I'm trying to make the product of two square matrix with some threads in the soup. I've already worked on some fast single-threaded product (with some cache-friendly tricks), and ...
1
vote
1answer
66 views

Reading input fast in Java for competitive programming

I have been solving problems on Timus Online Judge. In the beginning, I didn't worry much about I/O operations, so I just took some code from the internet and focused more on the logic. But after ...
4
votes
1answer
63 views

Looping through Files in a Folder

I have this simple looping macro, but I can't seem how to figure out how to make it run faster. I tried including more update = false statements as well as well as ...
-1
votes
0answers
20 views

How to use mmap to read one string at one time? [on hold]

The following code reads a very large file (of the order of 5 Gb) that contains different strings at each line. However, the method used in the following code reads one character of the file at one ...
6
votes
3answers
178 views

Base converting with strings from bases 1 to 36 to bases 1 to 36

I'm writing a fastest-code challenge over at PPCG relating to base conversion of bases 1 to 36, and as a part of the process for writing the competition, I decided to write my own program for it. This ...
0
votes
0answers
45 views

Parsing JSON in one go

I need to parse a simple JSON string (flat JSON, no hierarchy) for keys and values, and there is a system constraint that I cannot use any built-in JSON library and can only read a string once due to ...
3
votes
2answers
49 views

Optimzation removeClass() and addClass()

I am trying to simplify and optimize these line of codes. This is a jQuery function controls a <div> to expand up or expand down. This is my coding ...
4
votes
1answer
39 views

Construct binary tree from inorder and postorder traversal

The problem is taken from here. The tree is guaranteed not to have duplicate elements. My questions is, instead of creating new arrays leftInOrder, ...
5
votes
1answer
93 views

How to lose plants and aggravate people

Courtesy of a few posts around here I've discovered HackerRank. Poisonous Plants is one of their challenges. Of course, skip the following if you'd like to try it yourself. Challenge: There are ...
-1
votes
1answer
53 views

Operations on a vector

I have the following class which is used for operations on a vector. The vector stores the following struct which has 3 enums and 1 boolean. Info represents a computer node. Nodes communicate with ...
1
vote
1answer
48 views

Transforming a list into a dictionary

I have a simple list and want to filter it by a specific key. But I guess my for loop solution is not an efficient way. I'm searching an other way or one best practice. ...
1
vote
0answers
46 views

Vectorising orthogonal-triangular decomposition for 3D matrix

I am trying to optimise the computation time of my code (for the second time after a first optimisation that gives very good results). Currently, this code is very time-consuming depending on the size ...
3
votes
2answers
63 views

Find two numbers that add up to a given total, from a formatted string

The full challenge from codeeval.com can be viewed here. Input Your program should accept as its first argument a filename. This file will contain a comma separated list of sorted numbers ...
2
votes
2answers
121 views

Efficiency of vector like class

I've written a vector-like class in C++ and I'm trying to figure out issues in efficiency. When I use clock() to measure the time taken to emplace objects, ...
1
vote
0answers
17 views

MySQL Group PO Data in Ranges with Avg Number of Approvals

I expanded the query provided by Gordon Linoff ...
-3
votes
0answers
54 views

Which is best practice? an If statement vs the latter [closed]

I have the following two code examples which accomplish the same task: ...
6
votes
1answer
62 views

Householder transformation

I'm trying to make this Householder method run as quickly as possible. It runs fine now, but I'm still a bit new to java, is there anything you guys see to make this run faster? ...
6
votes
1answer
68 views

Retrieves Data From Various Excel Sheets Online, sorts, edits, and Analyzes said Data

This is a routine I wrote to streamline analysis I need to do that originally took 1.5 hours and now takes about 4 minutes total run time. I'm fairly new to Excel VBA so I welcome all criticism and ...
-1
votes
1answer
56 views

c++ measuring execution time

The purpose of the following code is to measure the execution time of a simple operation (1+1) and of a call to a function who does nothing (foo). The code compiles and seeme to work properly, but ...
4
votes
0answers
33 views

Parallel popcount of packed bytes

I want to do a popcount of bytes in an array. Not a total popcount of everything, but lots of little popcounts for every individual byte to determine the neighborhood count in GoL. The following ...
12
votes
2answers
365 views

Gravitational Brute Force N-body Algorithm

I've just started dabbling with code, and as a learning exercise I've written a simple algorithm for solving gravitational n-body problems numerically in JavaScript. I would be very grateful for ...
5
votes
2answers
112 views

ArrayList implementation

Can someone help me optimize speed for my code? I tested it via stopwatch in milliseconds. I've implemented my own ArrayList and I would like to improve its speed ...
1
vote
1answer
46 views

Searching Subdirectories of a Subdirectory for Registry Keys to Delete

Please let me know if I can improve my question in any way I build/maintain an IT Support Self-Help App and recently had the need to include some registry key manipulation when users experience ...
3
votes
0answers
30 views

Segmenting brain images (Dicom format) using region-growing algorithm

How do I increase its performance? %CORD_XY(1),CORD_XY(2) is the seed point %LEN Denotes the number of images in a folder %num is used to iterate in "for loop" % "img" here is single image from the ...
2
votes
1answer
47 views

Controlling parallel jobs with condition_variable

I'm trying to set up a system where I can have an arbitrary number of parallel tasks, all of which wait for a go signal, do their work, and then stop while a ...
1
vote
0answers
44 views

XOR 256 Block Encrypting and Decrypting

I am quite new to Go but have found it to be very useful for my use case (game server). I have a routine that encrypts/decrypts the game packets which was written in C++ which can be seen here and ...
4
votes
2answers
67 views

Computing the divisor sum in bulk without division, multiplication or factorisation (SPOJ DIVSUM)

SPOJ problem #0074 DIVSUM - Divisor Summation requires computing the sums of proper divisors in bulk (200000 test cases, time limit 3 seconds): Given a natural number n (1 <= n <= 500000), ...
6
votes
2answers
54 views

Increase permutation calculation efficiency

I have the following program running. It has so far been taking several days straight and has yet to finish. So, I'm just wondering if there is any way it can be optimized or better structured to ...
2
votes
0answers
37 views

Protection for cells in Google Sheets

Is there some way to speed this up, since it keeps timing out while running? The spreadsheet is shared with a Google Group with editing permissions. I've loaded what I can into memory but each ...
-2
votes
1answer
77 views

Java REST WS function calling DB taking lot of time

I have a REST WS in Java using jersey that connects to database. I don't know what should be the ideal time for execution but I feel the time it takes is too much. The actual call to DB completes in ...
1
vote
1answer
28 views

Hibernate Save method practice

We are new into hibernate, in our project for saving an entry the below given code is used, please have a look. ...
1
vote
2answers
44 views

Small PHP CMS base

I am a bit worried about this small PHP base as it has been running a bit slow. Can anyone notice anything majorly wrong with it? root/Index.php: ...
-1
votes
0answers
45 views

performance issue of application using entity framework 6

I have a console application in which I used Entity framework 6. In order to reduce the time of the first instanciation and the first read operations . I used Three ...
2
votes
1answer
56 views

Incremental Steepest Descent (gradient descent) Algorithm

Here is the code I wrote to calculate the minimum of a complex function. The code uses the incremental steepest descent algorithm which uses gradients to find the line of steepest descent and uses a ...
3
votes
2answers
58 views

Adding an 'enemy' to a game (with randomized properties)

I'm working on a game using the now abandoned Famo.us Javascript framework. I have the game in a running prototype and I'm building with Cordova and running it on an iPhone 6 using PhoneGap. There ...
2
votes
2answers
53 views

Python combine two integers to a third

We have three integers: A, B, C where the first (i.e. the most significant) digit of C is the first digit of A, the second digit of C is the first digit of B, the third digit of C is the second ...
2
votes
3answers
85 views

Most efficient multi-find/replace solution in Excel VBA

I'm looking to improve the runtime and efficiency of my VBA code that performs multiple Replace operations on an Excel Spreadsheet. I started out with the following ...
1
vote
0answers
20 views

Adding information to a compressed file and compressing the output

I wrote this script for adding information to a compressed file and compressing the output: ...
23
votes
5answers
3k views

Performance of a Foreach inside a Foreach iterating through a million records

I have two DataTables: dt: is populated from a CSV file with over 1.7 million rows dataStructure.Tables["AccountData"]: is ...
1
vote
3answers
113 views

Iterating and updating 35000 dictionaries

I'd like the function below reviewed. I'm especially interested in improvement ideas to process the API responses faster. products_list is the API response in the ...
3
votes
1answer
60 views

Backing up files to remote servers

I have code that backup files to remote servers. There are 2 pandas data frames: storedfiles: that points to the files already stored in previous runs ...
0
votes
0answers
34 views

Performance Optimized Project Euler Problem 14 in Clojure

Here is the problem: The following iterative sequence is defined for the set of positive integers: n → n/2 (n is even) n → 3n + 1 (n is odd) Using the rule above and starting ...
0
votes
0answers
30 views

Naive-Bayes classifier, to be packaged in a function

I need to create a Naive-Bayes classifier. I have eight labels (S) stored in tumors object, and 20531 attributes (A), I have stored the P(S,A) in objects of name ...