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
11 views

Java web scraping robots

I am developing application that goes through 2 websites and gets all the articles, but my code is identical in most parts, is there a way to optimize this code actually :/ (TL and DN are the naming ...
2
votes
0answers
19 views

Counting primes less than n

The following code was written to be a submission to this challenge on PPCG. It uses this algorithm, the Meissal-Lehmer method. I follow the Wikipedia entry pretty naively, except I tried to memoize ...
2
votes
1answer
24 views

SICP - exercise 1.11 - tree recursion

From SICP Exercise 1.11: A function \$f\$ is defined by the rule that: \$f(n) = n\$ if \$n < 3\$, and \$f(n) = f(n-1)+2f(n-2)+3f(n-3)\$ if \$n >= 3\$. Write a procedure ...
12
votes
4answers
410 views

Generating formatted multiplication tables in C++

I am self studying C++ from Robert Lafore's OOP in C++. I am solving the first exercise questions of chapter-3 loop and decisions. I've written three different codes using different approaches. I want ...
4
votes
3answers
58 views

Extracting sleep quality scores from periodic readings

How can I optimize the next function to work faster? The function must prepare a list to put in a CSV file. The list must contain values of average percentage of sleep per minute counted from ...
3
votes
2answers
39 views

Document term matrix in Clojure

This is my very first foray into Clojure (I'm normally a Python-pushing data-type). I'm trying to create a simple term-document matrix as a vector of vectors, out of a vector of strings. For those ...
2
votes
0answers
25 views

Median filter for large mask

I'm trying to implement the fast median filter developed by T.S.Huang (HUANG, T.S. 1981. Two-Dimensional Signal Processing II: Transforms and Median Filters. Berlin: Springer-Verlag, pp. 209-211.). ...
1
vote
0answers
21 views

Update method using timer in WinForms Poker app

I have a WinForms Poker app that needs to update some stuff and im doing this by using a timer: ...
2
votes
1answer
64 views

Poker app in C#

I am developing a poker application using C#. It is almost done, and I'm looking for improvements. One of the things I wonder is whether I should change my method that checks if the player has a ...
3
votes
1answer
58 views

Python 4 Players Snake Game

I would really like to hear out some suggestions as well as general response to the code I've written for 4 players snake game. It's my first time using pygame module, as well as trying to design a ...
4
votes
2answers
45 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 ...
6
votes
4answers
795 views

Fast Number Factorization in Python

Here's my implementation to factorize a positive integer: ...
4
votes
2answers
40 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
2answers
70 views

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

I am making a game for my computer science class. My professor's requirements are: Write a Processing program that draws a triangle in the middle of the window. Rotate the triangle when the left and ...
3
votes
2answers
316 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
66 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
353 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
91 views

Joining huge CSV files and splitting the result into batches

I've got ~20GB of data about the same subject, concatenated from small files of 16kB, each produced by different measurement equipment. They share some headers (on the example: B, D & E) and they ...
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
67 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
65 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? [closed]

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
179 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 ...
2
votes
2answers
93 views
+50

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
41 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
94 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
54 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
49 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
64 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
122 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 ...
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
367 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
113 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
45 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 ...