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 (3)

2
votes
1answer
16 views

Correct 4 bytes out of 65K to match a crc32 checksum

I have a corrupted png image. I checked and the crc32 checksum of the first chunk (size ~65k) does not match with the one I get. I am sure of this. Also, I have ...
1
vote
0answers
11 views

Penalized logistic ridge regression

This code takes a really long time. Can anyone help to make it faster? This code is for the penalized logistic regression that we should to chose \$\lambda\$ in regularization to control the trade ...
2
votes
1answer
20 views

Converting polar coordinates to Cartesian coordinates

I have a functional script that converts polar coordinates to Cartesian coordinates and then matches a value in a separate array to the coordinates. It works well, but I find that it takes a long time ...
1
vote
2answers
35 views

Generate all available numbers for pattern, shuffle and save to multiple files

I've build simple application that allows me to generate all numbers that have desired length and start with prefix. For example if I specify 12 as prefix and set ...
1
vote
1answer
14 views

For loop step including last value

I've got the following code. I want to loop through my dataset (which is a matrix) in steps of let's say 50.000 and perform biglm on it. ...
7
votes
2answers
217 views

Generating 3 combinations in Python

I have been experimenting around with generating all the n-combinations of an array. This code quickly generates all \$\text{k-combinations}\$ of a given array. I am testing my own implementation ...
-4
votes
0answers
26 views

computational performance, Microsoft Visual c# vs Intel® Visual FORTRAN [on hold]

i am programming in c#, but recently i was trying to check performance, taking c# to it's limits via unsafe and parallelism..etc'. then i have discovered that for things like low level computations ...
-4
votes
0answers
23 views

Fastest infinite loop [on hold]

What is the fastest way to have in infinite loop in ruby that increments by 2. Here is what I currently have for a in 3.step(2) #Do things end
3
votes
1answer
44 views

Next multiple with only 1 and 0 as digit

Problem: Find a multiple of a given decimal number \$N\$ that looks like a binary number. The input will consist of at most \$2\times10^5\$ lines, each line consist of an integer \$N\$ (\$0 < N ...
2
votes
1answer
41 views

Optimizing binary search tree

How could I optimize this binary search tree? ...
4
votes
3answers
275 views

Outputting Fibonacci numbers

My program gets some input values and outputs Fibonacci values. Generally, I'm adding single numbers from the right to left, and I'm saving it in the sum value and get rest of it and add to string. ...
2
votes
1answer
31 views

Create symmetrical matrix from list of values

I need to make a matrix (in the form of a numpy array) by taking a list of parameters of length N and returning an array of dimensions N+1 x N+1 where the off-diagonals are symmetric and each triangle ...
1
vote
2answers
35 views

Multiplying 4*4 matrices

I'm multiplying 4x4 matrices for learning purposes. How can I optimize this for performance? HTML ...
1
vote
1answer
35 views

Performance impact of using the universal selector in CSS

I am using the universal selector in CSS: #containerDiv.containerTable tr td * { max-width:240px; } But Visual Studio suggests: "Performance: Never use the ...
4
votes
2answers
47 views

Strand Sort in Python

After reading about Strand Sort on Wikipedia and testing the provided Python version, I decided to try my hand at a faster implementation. I've studied the "Time Complexity" page, read many different ...
4
votes
1answer
29 views

Simulating dynamic systems and postprocessing

Inspired by this question, I modified the script to run a simple simulation of Taylor-Green vortex using LBM and post-processes it using P5*js (an official Javascript port of the Processing API). ...
4
votes
5answers
51 views

Create matrices of a certain format

I need to create matrices that follow a specific format: the matrix is a square NxN matrix and the off-diagonals all have the same value (param) and the diagonals ...
5
votes
3answers
887 views

Will multi-threading or other method make my program run faster?

I didn't use multi-threading so far as I didn't need to. But as far as I've read, implementing them will make my program slightly faster than it actually is. ...
4
votes
4answers
70 views

Calculating average grades

I'm a C# developer looking to learn more about Python and how to think in a more functional programming manner. I have the following which takes a series of grades and returns the average: ...
4
votes
1answer
47 views

Sudoku type grid generator

I'm trying to make a program which prints different sized grids (n by n grids). These grids cannot have the same number in any column or row (like a Sudoku). My ...
4
votes
2answers
61 views

Find if the prefix of the string exists in the values of the hash table

I have a hash map which maps to some strings which serve as prefixes and are of small length (max length is 6): ...
4
votes
0answers
58 views

Java program to count the repetition of characters in a string [closed]

I solved a problem recently and I want to check the code I have written is good or is a bad design. Is good or poor in terms of efficiency. The problem is given an input string count the number of ...
-1
votes
0answers
65 views

Slow C++ in house mathematical formula calculation method [closed]

I have this formula calculation in my C++ codebase that gets called in a tight loop. I'm quite interested what would be possible to help speed this code up without knowing the formula? I can't really ...
-1
votes
0answers
18 views

Running slider animations on a site

I am trying to debug the animations on my site. I did most of the development on my desktop and it all ran fine, but on my laptop, it runs laggy when the slider animates. I think it is a CPU thing, ...
2
votes
1answer
63 views

Counting nonexisting records with foreign key

I have two tables Room and RoomDate. Here's the structure for Room Room roomID checkInDate checkOutDate roomType Here's the structure for RoomDate. They have a ...
4
votes
1answer
80 views

Ad-hoc lexical scanner

Challenge: Build an ad-hoc scanner for a calculator language. Specifications: The tokens for the language are as follows: assign → := plus → + minus → - times → * div → / ...
2
votes
2answers
52 views

Generating a PANDAS DataFrame of simulated coin tosses

It's taking my machine quite a long time to execute 1 billion (1st loop x 10, 2nd loop x 1000, 3rd loop x 100,000) instructions. Suggestions for performance enhancements? Sources of potential concern: ...
-4
votes
1answer
54 views

How can I optimise this simple piece of code

This code draws a number of cubes on the screen selected from an array in one of three colours. How can I make it more efficient? ...
1
vote
0answers
12 views

Reviewing LLBLGen code for dropdown databinding

I'm using a lookup table to store all my data for comboboxes (like gender male, female etc.), in order to give an easy management tool in my cms. I am using LLBLGen for my DAL. ...
3
votes
0answers
32 views

Calculating the nth prime number in java for huge BigIntegers

I wrote this simple class for calculating the nth prime: ...
-2
votes
0answers
69 views

Is there a way to reduce the execution time of the following code

I am a beginner trying to learn javascript at Hackerearth. There was this problem: Marut is great warrior. Marut loves his girlfriend Shizuka very much. Being jealous from Marut's love, the ...
3
votes
1answer
49 views

Formatting a CAN bus message as a string

I am writing a CAN bus logger application and need to format messages as quick as possible in order to prevent buffer overflows on our device. In some cases I am quick enough, but under heavy loads it ...
4
votes
3answers
39 views

Warshall's algorithm for transitive closure

I was going through this code for implementing Warshall's algorithm. I think the time complexity for this simple problem is huge because there are too many loops running here. The time complexity for ...
2
votes
0answers
24 views

PowerShell running slow on startup

I have a GUI file which is currently being ran by VBS, but I have a few issues: PowerShell v2 is what is being run on every machine and I cant change that, runs very slow on first time launch. it ...
10
votes
3answers
648 views

Listing human-readable enums

I'm trying to do some util class to operate on enums - convert Enums to its special strings representation via interface method. String stored in enum constructors. ...
3
votes
0answers
12 views

Obtaining employees and their roles, and vice versa

I am using the following query to obtain a employee with his information, and get all his related roles. The query underneath works fine when we check only 1 location taking only about 0.002seconds to ...
3
votes
2answers
255 views

Printing out a diamond with a user-inputted size

I made a program that prints out a diamond with n lines. n is equal to whatever the user inputted. I know I overuse the ternary ...
1
vote
3answers
119 views

Checking user access to servers

I have pasted a method I wrote, which is too slow to my liking (easily takes 60+ seconds to execute). The method loops through 12 different servers, checks if userX has access to any of the databases ...
2
votes
2answers
28 views

Populating dropdowns that are based on others

I created two dropdowns, a dadand a son that are populated based on two arrays that, hypothetically, can't be changed. When ...
5
votes
3answers
831 views

“The Minion Game” challenge

This is an implementation of the minion game, which takes in string input and declares a winner between two pre-determined players. The logic is player 1 gets all sequenced words not starting with a ...
4
votes
1answer
37 views

Random Forest Code Optimization

I am new to Python. I have built a model with randomforest in python. But I think my code is not optimized. Please look into my code and suggest if I have deviated from best practices. Overview about ...
4
votes
2answers
317 views

Simulation of 2 dice rolls

I wrote a program that records how many times 2 fair dice need to be rolled to match the probabilities for each result that we should expect. I think it works but I'm wondering if there's a more ...
1
vote
1answer
66 views

Delete lines one at a time from text file used for batch processing

I am writing a CAD program plug-in which is used to batch translate a list of CAD files stored in a text file. After each individual CAD file is successfully processed I want to remove the CAD file ...
1
vote
1answer
24 views

Operating multiple columns of one pandas DataFrame using data from another

I have a DataFrame of data from a survey that was repeated over several years, asking people about their income and how much money they had in savings. For simplicity, let's pretend it looks like ...
1
vote
2answers
22 views

From scratch pub sub definition and implementation

I am finished with my implementation of PUB/SUB or Observer pattern, however I just want to see any ways that I may be able to improve this pattern. I wanted to be able to use the typical ...
3
votes
1answer
72 views

Making change using the smallest possible number of coins

I have written code based on the Greedy Algorithm. The example can be found here. Problem: Make a change of a given amount using the smallest possible number of coins. Coins available are: ...
1
vote
2answers
73 views

Brotli compression algorithm, translated from Python into Haskell

I have converted some code in Python into its Haskell equivalent. Python implementation: ...
4
votes
2answers
51 views

Achieving a rotated Vector magnitude

I am trying to convert this velocity into another 2 dimensional vector at some specified angle: ...
4
votes
2answers
58 views

Reading data with different but similar semantics

I am writing code that reads data from a DB, where boolean values are stored as 0/1 nullable integers. I decided to write a simple function to encapsulate the logic which converts the integer values ...
1
vote
0answers
19 views

Optimize time for file download

This is the code snippet to download file from a URL. This code works fine. I want to know is there any optimization I can do to download the file faster or any other suggestion will also be ...