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

2
votes
1answer
25 views

HTML Compressor with regex

I would like to compress a Magento HTML page using some regex, and this is what I have written: ...
2
votes
1answer
49 views

Divide certain distinct row values into separate columns

This might be difficult for me to describe clearly but I will try anyway. Also note that this is entirely speculative; it might not even be able to run any faster (that is why I am asking). This is ...
3
votes
1answer
34 views

Slow Javascript code to get Taxonomy terms from Sharepoint

We have the following code which takes about 5 seconds in a modern computer, however the application is also executed on old PCs with Windows XP, and in there it takes 5 minutes to load. I know the ...
0
votes
3answers
50 views

Looping to update article codes on one server based on queries on another server

I've read somewhere on Stack Overflow that doing queries in a loop is very inefficient. It will hammer your SQL server and make your script very slow. Sample code: ...
2
votes
0answers
21 views

HLSL Shader Model 4: Is there a way to avoid pixel shader computing all code paths?

I have a pixel shader that needs to output either a plain colored pixel or a texel sampled from one of three textures - selected by a switch statement operating on an index fed in by the vertex ...
5
votes
1answer
34 views

Slow query joining orders and products

The end result I am trying to achieve is an array containing the total ordered qty for each product. I have been successful but the query takes about 20 minutes to run and I'm wondering if there is ...
-5
votes
1answer
30 views

Java Improving code efficiently [closed]

ve used the following function in one of my programs. I have tried to make sure that my code is efficient however I cannot find any help online to tell me how to recognize where I could improve... ...
8
votes
2answers
75 views

Making Multiple Copies of a Pattern

Here's a function for making multiple copies of a block of memory in another block of memory. It handles the case when the size of the target is smaller than or not a perfect multiple of the source ...
6
votes
2answers
47 views

Modular arithmetic brute-force congruence finder

My full code is running too slow. I do profile.run to my project and found out this function consumes a lot of time. The main problem is just to return an array containing all \$x\$ satisfying both ...
12
votes
1answer
49 views

Parallelization of number factors using OpenMP

For a simple try at parallelization on my own outside of school, I've created a number factors calculator. I hope to eventually come up with something more creative. Since I don't have access to ...
5
votes
2answers
834 views

How can I find out why this Rust program to echo lines from stdin is slow?

Given the following Rust program: ...
3
votes
0answers
38 views

Scraping efficiently with mechanize and bs4

I have written some code that scrapes data on asteroids, but the problem is that is super slow! I understand that it has a lot to scrape, but as of now it has been running for 5 days and is bot even a ...
2
votes
1answer
40 views

Process zip files

I have zip bundle, for example, abcd.zip, contains more zips like 1.zip, 2.zip etc. Inside of each child zip there is a .jpg file like 1.jpg, 2.jpg etc. There are so many other files but I need only ...
2
votes
0answers
25 views

Speeding up loop-rich Matlab function to calculate temperature distribution

I would like to speed up this function as much as possible in Matlab. This is part of a bigger simulation project, and as it is one of the most called functions within the simulation, this is crucial. ...
3
votes
2answers
53 views

BigRational based on BigIntegers

For Project Euler I've implemented a BigRational. The functionality is rather limited, just things I needed or will probably need soon. The style departs a bit from ...
2
votes
1answer
25 views

Write to a new, modified Excel file from an original one

I noticed that I've a HUGE bottleneck in this following function of mine. I can't see how to make it faster. These are the profiling test results(keep in mind that I'm using a PyQt GUI so times can ...
3
votes
2answers
64 views

Speed up loop through JSON

I have the following function that takes JSON and turns it into table rows: ...
3
votes
1answer
44 views

Parsing Lua 5.2 strings with patterns

I wrote some code to parse Lua 5.2 strings in Lua 5.1, using patterns. It's a bit too slow, but it works fine as far as I tested. ...
9
votes
1answer
225 views

Multiplication 128 x 64 bits

I was fooling around with the Collatz sequence a bit and found out that long is only sufficient for starting values below ...
7
votes
3answers
81 views

Removing equivalent authors in a list

I have a list of authors, where seeking duplicity. The indexes of these duplicates are stored in a list of lists named duplicity. For example, at index 0 in the list duplicity is nested list, which ...
3
votes
1answer
22 views

Loading and displaying JSON quickly in PhoneGap app

I have this tap event in an iOS app that I'm developing with PhoneGap. When I click on the left arrow, it finds the desired content and retrieves it from a JSON file. It then displays those results on ...
2
votes
1answer
58 views

2-opt algorithm for traveling salesman

I wrote a 2-opt algorithm to be used in a program and noticed (using profile) that the 2-opt is eating up a lot of time. I have tried a few things to make it run faster, but I am out of ideas. Any ...
5
votes
5answers
169 views

File System Read Buffer Efficiency

Context I'm working on a new Enterprise Library at my company and I am implementing some code that will be used to read files into memory. Since this is an enterprise library to be shared across the ...
2
votes
1answer
69 views

Finding matching Node instances in an array - running slow

I have encountered a performance issue in Swift. I compared the same method between C# and Swift: Swift is much slower than C#. Here is the code I'm working with. Could some one help me to speed it ...
7
votes
1answer
219 views

Improving performance of a VBA code to read contents of many .CSV files

I'm fairly new to VBA and just completed my first script. It's completing the task I want it to do just fine, but it's really slow* in doing so. It has to open and read about 1000 csv-files, for each ...
11
votes
3answers
476 views

Predicting the next pseudorandom value

The archived material for the Stanford University course on cryptography at coursera.org includes a problem where you have to predict the next output of a weak PRG. It can be briefly restated as ...
6
votes
1answer
86 views

Performance of A* route

I'm new to the Swift language. I have a C# version of a simple A* route which is very fast. But I rewrote it with Swift, and the performance is very bad (3,4 seconds for a very simple road). Could ...
3
votes
1answer
43 views

Generate Random String and Writing to File

my task is to generate random strings and store in a file till the size of file is less than 10MB. My approach towards this problem is as follows. ...
5
votes
3answers
90 views

Selecting Employee details from a complicated schema

I have a "litte" problem with my stored procedure because I need some values selected at a point in time. I need to do many select and group by's in my Left outer join which looks and feels like I am ...
3
votes
3answers
313 views
4
votes
1answer
82 views

Speed up lights-out variant solver in pure Python

I'm doing some challenges to learn new and interesting concepts, this one is about a Lights out variant, instead of toggling only the adjacent tiles, it toggles the whole row and col. It must be ...
3
votes
1answer
34 views

Changing cuts to sed for parsing dates from apache log (common log file)

Would switching my cuts below to SED improve performance? I am trying to get a per date count of requests for the last two weeks from a server log. The script runs, but slowly (comes in around 14 ...
0
votes
1answer
33 views

Optimizing execution time of merging images

I am using the below code to merge two images, but it take avg of 6-7 sec for creating 16 images. Is there any way I can speed up my process? ...
3
votes
1answer
28 views

Bottleneck encountered returning records for my grid

I am using MVC 4.0/C#/EF4.0 and I have a grid page that grabs results that are filtered, sorted and paged. It's filtering results from a table that has 45,000 records. How do I improve performance? ...
3
votes
3answers
45 views

HTTP Performance Test in C#

I wrote a script to test how long it takes to make requests against a url. It takes a list of urls, an array of concurrent requests, and a number of times to attempt the test. How could I improve on ...
3
votes
2answers
56 views

Improving Matlab function within big simulation

I have a very big Matlab simulation project in my hands, which I wanted to optimize, since I'm running it many times to tune parameters and the like. Using Matlab's ...
-1
votes
1answer
74 views

Double Pandigital divided by 11 Python [closed]

This is the combination file ...
4
votes
1answer
114 views

Increasing performance and accuracy in multithreaded loop

I was wondering if the following set up will return consistent result, i.e. no thread function call will be skipped. Also, is there any way to improve the threaded loop? Note the first loop is the ...
2
votes
3answers
96 views

Checking the neighbor of the current cell

This is just checking the parameter you enter is a neighbour of the current Cell (which is obtained using getRow() and ...
3
votes
2answers
59 views

Creating large CSV file

I have a performance problem when trying to create a csv file starting from another csv file. This is how the original file looks: ...
4
votes
1answer
110 views

Harmonic analysis of time series applied to arrays

I've developed some code in Python to apply a harmonic analysis of timeseries (for satellite imagery data). It's based on this, but then I would like to optimize the performance. So instead of a ...
3
votes
1answer
55 views

Managing tree nodes

I have complex logic manage EnvDTE.Project and EnvDTE.ProjectItem for a VS Addin (VS 2010). I would like elegant, easily maintainable code that follows DRY and KISS principles. Maybe using helper ...
4
votes
1answer
74 views

Simple attribute parser for HTML

I am studying Java and trying to write an HTML parser, which should parse tag names and attributes. I wrote a class (code below) using the State pattern. This is necessary for my training project, ...
3
votes
1answer
39 views

SQL stored procedure for fruit checks with several joins

I developed a SQL stored procedure which works lovely, but when under stress, it takes more than 2 minute to get back to the user. I am providing the stored procedure but would also provide the table ...
3
votes
0answers
28 views

Weeding out triangles for triangle-triangle collision detection using a spatial hash

I am implementing a multi-phase collision detection system whose final collision check is checking the triangles of one shape against those of another. As the number of triangle-triangle comparisons ...
2
votes
3answers
115 views

Counting the out-of-order elements of an array

Is there any way to write that C function better so the procedure would spent less time to calculate the results? Assume that the array size is 1.000.000 and all the numbers are greater than 0. ...
4
votes
1answer
112 views

Intersection between arrays

I'm a Python beginner (more used to code in R) and I'd like to optimize a function. 2 arrays ares filled by integers from 0 to 100. A number can't appear twice in a row and they're stored in an ...
4
votes
3answers
242 views

Truncate String Method

I have 2 Truncate string methods. First: ...
6
votes
4answers
439 views

Sieve of Sundaram for Project Euler 7: Python implementation slower than C++ and R

A friend of mine recently started learning R, and she complained to me that R is very slow. She was working on Project Euler Problem 7, which asks for the value of the 10001st prime number. For ...
3
votes
1answer
52 views

Finding average word length in a given year

I have written a function which takes the year in question and words as a data which is a dictionary that maps words to the list of year/count. Now I am wondering how I can improve the code that I ...