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)

-1
votes
0answers
3 views

Javascript Running But Laggy When Slider Animates [on hold]

I am tying 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, but ...
0
votes
0answers
10 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
41 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 → / ...
1
vote
0answers
2 views

Python performance optimization

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

Calculating the nth prime number in java for huge BigIntegers

I wrote this simple class for calculating the nth prime: ...
-2
votes
0answers
65 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
44 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
37 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
17 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 ...
0
votes
1answer
18 views

Performance impact of interfaces on 2D Vector class [on hold]

I'm trying to build a fast and straightforward to use 2D Vector class. I would like to find a way to improve my code without losing performance. It's just a skeleton for now, but I would like to find ...
10
votes
3answers
613 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
10 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
245 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
115 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
27 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
810 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
35 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
310 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
63 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
20 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
68 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
63 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
50 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
56 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 ...
1
vote
2answers
279 views

Is there a faster way to search if a possible new entry already exists in a dataset?

For example if I have the following data table layout: ...
5
votes
2answers
52 views

Python code to run a C program that calculates whether points are in the mandelbrot set

This is part of a project to explore the Mandelbrot set. The code to graphically navigate the complex plane and allow the user to adjust the colormap and number of iterations is all written in Python, ...
1
vote
2answers
76 views

Euler problem 5

I am starting to learn Rust and it seems pretty awesome but it's way different than any C based language. I want to know how can I make this code more idiomatic and also how can I improve my solution ...
2
votes
2answers
32 views

Finding top most N common character grams in English

I suspect there might be a much more efficient way to accomplish this task. I would appreciate a more clever hint for performance increase. I am also looking for feedback on style and simplification ...
1
vote
2answers
138 views

Accepting a positive integer from either a command-line argument or System.in

I've been doing a lot of programs for classes that require a prompt from the program. I thought it would be much faster for me to rapidly test inputs if I didn't have to execute the program and then ...
5
votes
2answers
249 views

FizzBuzz for CodeEval

I'm a beginner programmer and decided to try some coding challenges. I found CodeEval and attempted the first challenge, FizzBuzz. However upon submitting my code I found that my submission only ...
4
votes
1answer
79 views

Checking digits in a number

I'm working on an exercise that counts the number of even digits, odd digits, or zeros in a user-input integer (I made it a long so the user could put in more ...
5
votes
2answers
61 views

Calculating numbers in the Collatz sequence

I have found two ways in which I can generate the Collatz sequence given a start number. I have looked briefly into their performance, but I'd like a more in depth/solid review into the difference in ...
8
votes
2answers
112 views

Searching string for character not in array

I have a string which I want to check for characters other than those in this list {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", ".", "i"} however this check gets run several thousand times a ...
-2
votes
1answer
29 views

Initializing a namespace tree [on hold]

I have a global namespace where developers attach object singletons, class definitions, constants, etc. Each JS file has its own crafty flavor of namespace tree initialization. Maybe a module pattern ...
7
votes
2answers
99 views

Efficiently checking if a large enumeration has a consistent order

The scenario is as follows: We have a streamed enumeration that we have to check if it's ordered or not before processing it (about 75-80% of the time it is ordered). We are talking about pretty big ...
1
vote
1answer
34 views

Adjusting the height of a div to match that of another column

This code checks whether an image whose parent is .papers.left has completely loaded into DOM and if yes then the background of ...
2
votes
3answers
61 views

Rotate and translate a 2D point N times

This is a C++ program that rotates a point initially located at origin by a given angle A (degree) counterclockwise and L translate its x-coordinate (sum L to it). Here is my program: Firstly it ...
1
vote
0answers
28 views

XML/HTML batch generator

As part of an exercise I've written some code to generate multiple HTML files based on information stored in a couple of XML files. I'm not really sure how much code you'd need to evaluate my function ...
4
votes
0answers
62 views

Learning OpenMP+MPI: Feedback and comments on Gauss-Seidel+SOR

I am learning OpenMP+MPI hybrid programming. As an example I have chosen Gauss-Seidel+SOR. My implementation uses MPI_THREAD_FUNNELED style hybrid programming, ...
3
votes
1answer
90 views

Project Euler #14: Longest Collatz sequence

Problem : source Which starting number, under one million, produces the longest chain? n → n/2 (n is even) n → 3n + 1 (n is odd) I want to receive advice on my code. It is too slow... It ...
1
vote
0answers
13 views

Get similar posts with manyToMany relationship: Make faster

I have table 'post' with manyToMany relationship to 'tag' and 'product' tables. post <---> tag post <---> product For example, if I have post, I can get similar posts similar by tags and ...
3
votes
0answers
36 views

Multiple many-to-many filter with range using filteriffic

I should say that the code I have works. I feel like there has to be a much more efficient way to do it (especially when I just crashed my server with it). Relevant schema: ...
2
votes
0answers
60 views

Greyscale converter performance in Swift

I have a single class which converts an image's colors into greyscale (except one given color, which will be left as it was before): ...
6
votes
2answers
95 views

Random Word Splitter

I wrote a word splitting function. It splits a word into random characters. For example if input is 'runtime' one of each below output possible: ...
1
vote
0answers
43 views

Optimizing R + ROracle performance

For my internship I have to perform certain analysis to determine residuals and outliers. The table I'm currently using has over 12 million records with 130+ columns. My first tests take approx. 5398 ...
10
votes
2answers
266 views

Unique value finder

For our first assignment in our algorithm class we are suppose to solve several different questions using information from a 2D array. We are also suppose to optimize our code to get more marks on our ...