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
votes
1answer
43 views

Code iterates through all rows and inserts value in cell for each

I would like that this code would now be done in a faster way: ...
2
votes
0answers
15 views

Watermark and join videos in bulk using ffmpeg

I have this batch file using ffmpeg to add a logo to my videos and then add an intro but it's taking anywhere from 10 hours to a day depending on how many I have to watermark, is there a more ...
2
votes
1answer
35 views

Mesh generation in Unity3D

I have a mesh generation script which initialises a mesh with vertices that represent my map tiles as quads. Then I pass the tiles that I wish to display on the mesh by setting my triangles for the ...
3
votes
0answers
71 views

Find all distinct 8x8 chessboards where 5 queens attack/occupy every square

Average time (without printBoard()) on Intel(R) Celeron(R) CPU N2840 of 100 runs: GCC 5.4.0 with -O3: 0.48885504s Clang 3.8.0 with -O3: 0.52578794s My ideas for ...
3
votes
0answers
27 views

Building a k-d tree in Python

To learn Python, I have implemented a function that creates a k-d tree from a list of 2-d Points. I would like to refer to this question where i asked about the k-d tree in C. However, the Python code ...
1
vote
1answer
47 views

Random permutation with defined order of last occurrences

This Python function takes two arguments: chr_list which is a mutable sequence of characters c ...
-6
votes
0answers
28 views

How to know good and clean code for google [on hold]

Please help me to review my site [originvietnam.com][1] [1]: https://originvietnam.com/halong-bay-cruises/ - is it good code for search engine? any recommendation? thanks
1
vote
0answers
9 views

AABB Intersections with Space Partitions, A Sample Code Performance and Reliability

I have originally written the following Matlab code to find intersection between a set of Axes Aligned Bounding Boxes (AABB) and space partitions (here 8 partitions). I believe it is readable by ...
3
votes
0answers
38 views

Show all full/partial search matches in the first worksheet from all the other worksheets

Search and display all instances of a full/partial match in the first worksheet from all the other worksheets in the workbook after running a macro to clear formatting of previous search results. I ...
2
votes
1answer
36 views

Dijkstra implementation for maze solving that works fine and returns shortest path

I would like to make my code "prettier" and also speed up the runtime of my implementation. Nodeinfo is literally just an object that holds its "parent node"(the node it came from) and its distance. ...
6
votes
3answers
94 views

Distance and force calculation for a molecular dynamics simulation

I'm writing an MD-like simulation and I'm having some difficulties in making this code run faster. I profiled the code using callgrind and kcachegrind, and it appears I'm using about 30% of my time on ...
4
votes
0answers
21 views

Sequence-based enumeration of permutations in lexicographic order

This is follow-up on On Knuth's "Algorithm L" to generate permutations in lexicographic order, where I presented the following method to enumerate all permutations of array elements in ...
3
votes
0answers
32 views

On Knuth's “Algorithm L” to generate permutations in lexicographic order

I needed a method to generate all permutations of given elements, so I decided to implement "Algorithm L (Lexicographic permutation generation)" from Donald E. Knuth, "GENERATING ALL PERMUTATIONS" in ...
1
vote
0answers
38 views

Memory optimization when finding the Cartesian product in Python

My function gets the Cartesian product of a list of lists of tuples. The function is correctly producing the list of lists, but it's a memory hog (and leads to a MemoryError for large data sets, with ...
3
votes
0answers
18 views

URLEncoder implementation Round 2

Half an year ago I posted an implementation of a URL encoder for review. I didn't have any time to work on it until recently, but now looking at my old code with new eyes I saw how unreadable the code ...
2
votes
2answers
58 views

Python value comparing taking too long

Is there any way to make this code run faster. I have to compare values in a text file which is written in the format: 1 1.12345 2 0.12345 3 3.45678... The values are in billions and the code ...
1
vote
0answers
26 views

Wrapper for GMP in C++

I'm writing a C++ high precision library based on GMP, sample code(files which have to be added to project): ...
4
votes
1answer
52 views

K-means algorithm very slow

I'm a beginner in Python but I have tried to implement K-means algorithm in python and it's working... but it's too slow... Instead of few seconds I can spend hours to finish it and I don't know why......
4
votes
0answers
100 views
+50

Sorting almost sorted array with a minimum heap

I'm currently looking into the quickest way to sort an almost sorted array: Given an array of \$n\$ elements, where each element is at most \$k\$ away from its target position, devise an ...
2
votes
1answer
25 views

Fetch Keywords from comment and assign keyword id to comment

I have a small callback function which receives a comment in array like below: ...
4
votes
1answer
37 views

Generating an image with all 15-bit colors, each used exactly once

I've blatantly copied fejesjoco's solotion to this codegolf into Rust, and was hoping for some feedback. Basically, it begins by generating a vector containing every possible 15-bit RGB color, and ...
-2
votes
3answers
62 views
-2
votes
1answer
31 views

Value passing for method parameters [closed]

Let's say I have a method as follows: public int getSum(int operandOne, int operandTwo) { return operandOne + operandTwo; } So whenever I'm calling this ...
1
vote
0answers
21 views

Radix-2 FFT C code

I'm a beginner in C programming. I am current trying to work on a project requiring 1024-point FFT implementation using radix-2, Decimation-in-frequency. I attach the FFT function C code below. How ...
5
votes
0answers
292 views

Increase the speed of this python code for text processing

I need to iterate through a file of words and perform tests on them. ...
4
votes
2answers
41 views

Base object to convert positive numbers into other bases (2 <= base <= 35) in Python

I'm fairly new to Python (this is the first thing I've done that really takes advantage of classes). This works and I'm happy with it; just looking for general advice. Especially nice would be input ...
6
votes
0answers
48 views

Naive implementation of KMP algorithm

After reading this answer to the question "High execution time to count overlapping substrings", I decided to implement the suggested Knuth-Morris-Pratt (KMP) algorithm. I used the pseudo-code listed ...
7
votes
2answers
101 views

Fixed size dictionary to achieve performance goals

In my open source project, I have code that use a dictionary very intensively so system dictionary implementation did not suit me due to performance reason. Therefore, I decided to write my own ...
3
votes
0answers
16 views

Selecting indices of a cell array that strcmpi-match the contents of another cell array

I have a Matlab structure with several fields, 3 of which are interesting here: ...
3
votes
0answers
83 views

Thousands of GET requests for brute-force authentication attempts

I am applying a brute force to discover 123456 passwords in a given site (I am not going to say which one, of course). The html gets a ...
5
votes
1answer
47 views

Increase performance of Bayesian likelihood equation

I need to calculate a Bayesian likelihood in its negative logarithmic form: $$-\ln L = N\ln M -\sum\limits_{i=1}^{N} \ln\left\{P_i \sum\limits_{j=1}^M \frac{\exp\left[ -\frac{1}{2}\left(\sum_{k=1}^D \...
8
votes
3answers
94 views

Perf wrapper for Excel VBA

Spoiler This code is actually BAD for performances! So don't use it! ;) For a while now, I've been using this wrapper to avoid retyping most of it : ...
5
votes
0answers
38 views

Make To and From date range picker using jQuery UI

I implemented date range picker logic using jQUery UI datepicker component. Here is my code: ...
1
vote
1answer
38 views

PagedList with large data sets

I'm using X.PagedList for paging functionality in my application. The code I have works fine but when I return larger sets of data it seems like it could be faster. Is there anything I can do to my ...
2
votes
1answer
27 views

Create several homogeneous arrays from a larger heterogenous array efficiently

I have a list of aircraft returned from a REST call which describes the status of each aircraft. In order to make the UI templating simpler, this single list is split into four homogeneous lists in ...
3
votes
1answer
42 views

Delete lines from a CSV file that contain fields listed in a text file

I wrote a powershell script to compare words from a text-file with a csv-column. If the word in the column matches, the line is deleted. ...
3
votes
0answers
50 views

Efficiently writing string comparison functions in Python

Let's say I work for a company that hands out different types of loans. We are getting our loan information from from a big data mart from which I need to calculate some additional things to calculate ...
4
votes
2answers
1k views

Hackerrank Submission Optimisation for Melodious Password

Given question from Hackerrank: a password consists of exactly n lowercase English letters. the password is melodious, meaning that consonants can only be next to ...
3
votes
0answers
38 views

Drawing a mask of the black pixels of an image [closed]

I'm drawing a pixel-by-pixel image with the following code ...
2
votes
1answer
68 views

Insertion and selection sort in PHP

I've implemented InsertionSort and SelectionSort in PHP and tested it with an array of 20.000 unique integers. It took many seconds to complete the insertion selection sorts. For comparison, I saw a ...
6
votes
1answer
95 views

SkipList implementation in Java

The code works fine, but could likely be better. How can I improve it? From Wikipedia: A skip list is a data structure that allows fast search within an ordered sequence of elements. Fast search is ...
2
votes
0answers
45 views

Pushdown-stack: Test if a pop order is legal or not

I'm currently working through "Algorithms in java" by Robert Sedgewick (3rd edition, in german) on my own and am trying to solve one of the exercises there. The exercise asks to develop and ...
7
votes
0answers
80 views

Simple game outcome simulator

I am trying to improve the performance of a monte carlo search algorithm that simulates random gameplays in a simple optimization game until a time limit is reached, and then returns the best outcome. ...
12
votes
5answers
561 views

Getting the dominant RGB color of a bitmap

I'm currently running this function 60 times per second in order to get the dominant color on my screen in RGB values. It is using approximately 15% of my CPU on 30FPS and 25% of my CPU on 60FPS. Is ...
3
votes
0answers
42 views

JavaScript copy paste cell values

The following function gets the lastly clicked cell value and pastes it into the edit box editBox, in which the user can then edit the value. Whenever the user goes ...
6
votes
1answer
83 views

Improving the performance of a webscraper

I have here a modified version of a web scraping code I wrote some weeks back. With some help from this forum, this modified version is faster (at 4secs per iteration) than the earlier version. ...
1
vote
0answers
40 views

RC4 implementation

I am using the following implementation of the RC4 encryption algorithm in C# ...
4
votes
0answers
40 views

Calculating parking and charging statistics for a car-sharing service

I am looking for help in designing my code more efficiently and also in keeping the slope of my personal learning curve steep: For a research project I have per car data from two different car ...
4
votes
0answers
31 views

Counting weather events for visualization using Gnuplot

I wrote this code to analyze ~800 MB of weather data from the US. I am planning on visualizing the data with Gnuplot and Gimp. I have already made the images and a gif file. This code runs somewhat ...
1
vote
1answer
74 views

Finding prime numbers performance

I am writing an app that finds prime numbers within a specified range. Currently i am updating almost every part of the app and i have also changed the way i find prime numbers. The problem is that ...