16
votes
12answers
2k views

How to improve very loopy method?

I have a method that has a lot of loops: private void update(double depth) { Console.WriteLine("update with level " + depth); ...
5
votes
4answers
198 views

Improve VBA code Excel

Im looking for someone who can improve my code, because at the moment it takes 4 minutes to execute. I'm new to VBA so it's probably bad coding. Normally if you are good in VBA you will understand the ...
5
votes
4answers
260 views

Improve speed for looping through 1,000's of items in javascript?

This is a script I use to count how many items are selected in a form. Currently it loops through the entire form to count how many check boxes are selected, each time a checkbox is clicked. The form ...
5
votes
1answer
123 views

How to speed up this following code

I am doing my research about scheduling by using Matlab. I am a new Matlab user and I have a problem with time execution of my following code: clc clear all A=8; B=12; C=10; ProcessTime= [ 11 11 11 ...
4
votes
3answers
235 views

How to improve this method? (Create text without repetition)

The basic idea is not to allow the same texts and add +1 at the end. Imagine that I have a datagrid (wpf) with names, and every time I click the add button, I will put a new name on the list ...
4
votes
2answers
491 views

Optimisations for this loop? (Garbage collection is slowing it down)

I'm working on a Game Of Life clone as my first project. I'm still relatively new to programming, so my code is probably not really optimised. The biggest bottleneck is in my Start() method, but that ...
4
votes
1answer
64 views

Looping through Radgrid in JS is slow, can this be faster?

I do a single select in one radgrid, and based upon that selection I want to select multiple rows in a different radgrid: <telerik:RadGrid ID="rgPaymentLines"> <ClientEvents ...
4
votes
1answer
180 views

Determine which level of the text that it is currently parsing

So I have this code in my program, and there are multiple variations of it. Just looking at it, I feel like there must be a way to make it more efficient, but I can't think of anything. Just looking ...
4
votes
1answer
138 views

Optimizing Python / Numpy Code

So I'm implementing a version of the mean shift image processing algorithm for color segmentation in python/numpy. I've written a pure numpy version of the actual mean shifting per pixel (which I ...
3
votes
1answer
331 views

Code's optimization and speeding up (Legendre's polynomials and functions) in Matlab

I would like to improve this function to reduce the run time and optimize it. function [Pl,Plm] = funlegendre(gamma) Plm = zeros(70,71); Pl = zeros(70,1); P0 = 1; Pl(1) = gamma; ...
3
votes
1answer
326 views

Nested while loop for getting db data. Timing out at random times because of the PHP. Any way to make this more efficient?

So today I jumbled together a script that would get data from a database, from different tables and such. I had wanted to just use simple ifs without the whiles, but I couldn't make it possible. The ...
3
votes
6answers
666 views

How can I improve the performance of this loop

#region GetBookListByPriority private static List<BCBook> GetBookListByPriority(List<BCBook> listBcBook) { List<BCBook> newList = new List<BCBook>(); try { ...
2
votes
3answers
2k views

reorder a list in java

I have three ways of reordering a list (think baseball order) and I am sure you can come up with more. What is a the best way? For example if input is list is 1,2,3,4 and current is 3 then the ...
2
votes
1answer
292 views

filter a collection in a PagedCollectionView

I have scenario wherein I have to filter a collection in a PagedCollectionView. The filter criteria are Name and status which are check boxes with Enabled and Disabled labels If Enabled is checked it ...
2
votes
2answers
196 views

Java - Object declaration out of while loop

Could you explain to me which code is better (more optimal) and why? Vesion 1: while(something){ Runnable task = (Runnable) taskQueue.dequeue(); Throwable ex = null; ... } Version 2: Runnable ...

1 2
15 30 50 per page