Questions related to improving application performance.

learn more… | top users | synonyms

2
votes
0answers
55 views

Python: How do I optimize the solving of ODEs?

I have been trying to figure out a way to optimize the solving of ODEs in Python but haven't been able to achieve this goal. I tried getting help via a bounty on SO using cython but nothing came of ...
1
vote
2answers
50 views

Time limit of a c program while calculating factorial of numbers in c

I am solving a problem on calculation of factorial and the challenge is as follows! You are asked to calculate factorials of some small positive integers. Input An integer t, 1<=t<=100, ...
3
votes
1answer
84 views

First Javascript - Geocoder - Can it be improved?

So I'm pretty excited to have coded my first javascript file which now works, and I've spent my evening trying to improve it. It takes a location in the #loc input box and geocodes it (gets ...
1
vote
1answer
39 views

Looking for code quality suggestions with my open source CFML database project

I just posted a small open source CFML project on github.com, https://github.com/jetendo/db-dot-cfc db.cfc is a standalone CFC with 472 lines of code. Anyone interested in reviewing the way this code ...
1
vote
2answers
86 views

Email report generation from database

I have written a small batch job which will collect data from db and send mail to user. Can you please do a review of the code with design prinicples in mind and also with best practices for Db and ...
3
votes
1answer
104 views

Improvement of my php code

I wrote a class with this function. Can I improve my code performance in the bottom of the function? I don't like the while loops! public function loadFields(array $fields, $as_object = ...
2
votes
0answers
67 views

How to improve readability and memory footprint of this haskell script?

I have this small haskell script that I wrote some time ago to parse a set of financial CSV files to produce other CSV files. I've recently had a problem with large input files (around 300Mb) that I ...
6
votes
1answer
155 views

Haskell Particle Simulation

I recently started learning Haskell and as my first project I decided to port a particle simulation I had written in C. The simulation is pretty simple. We have a cubic box with particles (spheres) ...
3
votes
3answers
142 views

Linq query performance improvements

As I am getting my Linq query to a functional point, I start looking at the query and think about all the "ANY" , and wonder if those should be a different method and then I have data conversions ...
2
votes
5answers
216 views

Performance: Divide group of numbers into two groups of which the sums are equal

I have a piece of code that divides a group of numbers into two groups of numbers of which the sums are equal. I created this because of a StackOverflow question: ...
0
votes
0answers
49 views

How to make the code more optimal?

Maybe some of you have an idea how to make the code more optimal? This had to be a little faster, because i cant pass few time tests :/ Unfortunately I can not add tests whose over time because they ...
3
votes
1answer
47 views

Selecting element from a collection based on bitwise-and result

I need to improve this section of code: uint32_t to_handle = 0; uint32_t test_const1 = Constraint3::VAL1 + Constraint3::VAL2; uint32_t test_const2 = Constraint1::VAL2 + ...
1
vote
4answers
99 views

improve this code for pattern

my aim is to design a function with arguments(int m,int n) so that output is like (for m=3,n=5) 3 34 345 34 3 i came up with this code void func(int m,int n) { for(int i=1;i<n-m+2;i++) { ...
4
votes
2answers
186 views

How can I memoize or otherwise optimize this code?

The code checks many more conditions like the one below. I was thinking to memoize it, but I can't think about how (writers block). How else could I optimize this? I know it seems silly, but my code ...
2
votes
0answers
61 views

Very fast query selector — did I miss something?

A few months ago, I wrote a query selector that seems to outperform the query selectors in the popular GP libraries by a pretty hefty margin. I'm wondering if I overlooked something; it seems odd that ...
6
votes
2answers
325 views

Speed up solution to Project Euler problem 75

I've been programming for a few months now, and have used Stack Overflow a great deal, but this is my first post. Anyway, I wrote this code for Project Euler problem 75, and was curious if anyone knew ...
2
votes
2answers
82 views

Improving the CRC code with “unsafe features”

I have the following CRC 16 code. Is it possible to improve the performance of the code with unsafe constructs. My knowledge about pointer arithmetic is rather limited. public enum Crc16Mode : ...
4
votes
2answers
209 views

Is there a better way to consume an ASP.NET Web API call in an MVC controller?

In a new project I am creating for my work I am creating a fairly large ASP.NET Web API. The api will be in a separate visual studio solution that also contains all of my business logic and database ...
1
vote
1answer
46 views

Please Review Performance Test and Idea: Initialize a widget

I want to extend an app object with a widget that initializes itself immediately. Immediately-Invoked Function Expression: var app = {}; (function() { app.widget = { init: function() { ...
6
votes
2answers
118 views

Generic wrapper for equality and hash implementation: Is there a way I can make it more efficient?

I was writing an answer in another thread and came across this challenge. I'm trying to have a generic class so that I can delegate the routine (and tiring) Equals and GetHashCode implementation to it ...
1
vote
2answers
97 views

What could I have done better with this code from a calendar?

I was writing a calendar a long time ago and, coming back to the code, I've realized that it's not the best. I was fairly mediocre at programming back then. I'm using jQuery, Mousetrap, and ...
1
vote
1answer
76 views

jQuery plugin: Parsing a JSONP feed using ajax()

I'm fairly new to JavaScript and jQuery and this is my first attempt at creating a plugin. The code below I've written to parse a JSONP feed from a search engine API (funnelback) using ajax() calls. ...
3
votes
2answers
118 views

Optimizing unboxed array operations in Haskell

Consider this simplified code which successively permutes array elements: import Data.Word import Data.Bits import Data.Array.Unboxed import Data.Array.Base import Data.Array.ST test3 :: UArray Int ...
1
vote
0answers
42 views

General Code Review - Key Press Handler

I have made a class to import into my projects to more easily handle the state of the keyboard so I can use stuff like: if(Keys.returnKey(37)){ As opposed to setting up key listeners. Could you ...
0
votes
1answer
77 views

Miller-Rabin Prime test (Speed is the main goal)

The code below is for testing Primes. testPrime(100000); testPrime(1000000); testPrime(10000000); testPrime(100000000); Now my goal is to make the code super fast at finding prime number, min-max, ...
1
vote
0answers
39 views

Can I make my render method more efficient?

I get great FPS with this as is, but I'm a performance freak and I don't know AffineTransform or the Java graphics libraries very well. I'm sure there is something I could be doing differently to make ...
3
votes
1answer
45 views

Finding missing items in an int list

Here is a problem I am trying to solve: trying to find missing photographs from a sequence of filenames. The problem boils down to: given an unsorted list of integers, return a sorted list of missing ...
1
vote
0answers
39 views

How to make this more efficient

I have a fitness function where inputs x1 to x14 have values between 1:4. Is there a way to make to more efficient, any suggestions are useful please. I need to get the computation time down. A ...
-1
votes
1answer
94 views

How to apply Sieve of Eratosthenes test into my code [closed]

I have this code that tests prime numbers and I'm trying to make it fast as possible. I know a way but I just can't find how to execute it in to my code. Does any one know how to input in to the code ...
1
vote
1answer
37 views

Return most common items in list (php)

I was wondering what's the best way to return the most common items in a list, so far the best way I could do it was: //@param string $this->matched_ids_list = 1,11,12,11,12, ...
0
votes
3answers
175 views

Primes Tester for speed performance

I was given a homework assignment in Java to create classes that find Prime number and etc (you will see in code better). My code: class Primes { public static boolean IsPrime(long num) { ...
0
votes
1answer
295 views

Responsive Left Fly out menu performance improvement

I am working on this website currently if you resize the window to less than 650px then the main menu is replaced by a button which when pressed triggers a left fly-out menu similar to the facebook ...
0
votes
1answer
55 views

Optimization: Eliminate conditional expression within common code

Background The following code (part of a natural language processor) was written to eliminate duplicate code by using isLeft as a conditional throughout the method: private void ...
1
vote
1answer
115 views

Improving performance of my python code

I wrote a python program that performs a Simpson integration of data. The program takes the areas to be integrated from a foo.ref file, with the following syntax: # peak m/z ...
1
vote
0answers
135 views

Density-based clustering of image keypoints

I have implemented the DBSCAN algorithm for clustering image keypoints, I'm using C++ and OpenCV, I have been following the pseudocode on the wiki page pretty strictly and its working but I get the ...
1
vote
4answers
93 views

Can you review my random number wrapper class

I made this class to handle any min max integer value and return a random number in the entered parameter range. I tested it to work with all combinations(I think). But is this totally wrong or ...
3
votes
1answer
93 views

Optimizing PHP script fetching entire HTML pages

The following script should get links which are stored in a text file (line by line), then put them into an array and finally scan each links' source code for a certain line. If this line is found, it ...
1
vote
0answers
50 views

BFS implementation to find connected components taking too long

This is in continuation to a question i asked here. Given the total number of nodes(employees) and the adjacency list(friendship amongst employees) I need to find all the connected components. Below ...
3
votes
1answer
180 views

Fastest way to delete a large folder using JAVA

I am trying to delete a large folders (with many levels of subfolders) over a network (i.e, on a remote machine. I have the following code and it takes 10 minutes. Is there a way to improve this, ...
0
votes
2answers
72 views

php script to retrieve enum values from sql table

I have an sql table with multiple fields and 4 of them are enums. I wrote a script that runs thought the table and retrieve the enums and put them in a 2 dimension array. Unfortunately this script is ...
1
vote
1answer
35 views

How Can I Improve my Image Preloading Script?

I wrote an infinite scrolling scrolling plugin for an app I'm developing. When requesting the second 'page' from the server, I loop through each image, and five it a very basic onload function. // I ...
4
votes
3answers
190 views

How to increase the performance of loop in Python?

I need to run over a log file with plenty of entries (25+GB) in Python to extract some log times. The snippet below works. On my test file, I'm ending up with roughly 9:30min (Python) and 4:30min ...
3
votes
1answer
56 views

how can i make this small jQuery serializeobject util any better

I have this little utility/helper which serializes a form into a javaScript object $.fn.serializeObject = function(fn) { var o = {}, a = ...
0
votes
0answers
50 views

Not sure if I missed some obvious CPU brakes

I have three functions (out of a medium 2 digit number of functions) which use up 80% of CPU time, so I kind of wonder if there are points for optimization that I am missing. Function 1, Extracting a ...
3
votes
1answer
113 views

Are these list-comprehensions written the fastest possible way?

This is a simple repeatable question regarding the usage of Python3's comprehensions: Could the Python3 syntax be used in another way to speed up the process, further so the gap between Python3 and ...
0
votes
1answer
79 views

Query Performance too Slow

Im having performance issues with this query. If I remove the status column it runs very fast but adding the subquery in the column section delays way too much the query 1.02 min. How can I modify ...
3
votes
3answers
171 views

Optimization Of Code With Runtime of 150Hours

XPost from Stackoverflow questions as Nicholas Pickering kindly referred me to this. I've been working on a project where I am importing a large document of documents and tokenizing each document. I ...
3
votes
0answers
56 views

Distance checking of normalized vectors?

I've been learning C#/XNA in an attempt to make a game for the past few weeks so maybe this is an obvious newbie thing, but here goes: I've been making a fairly simple 2D game, so I have a list of ...
2
votes
1answer
46 views

python Improve a function in a elegant way

I have a grid as >>> data = np.zeros((3, 5)) >>> data array([[ 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0.]] i wrote a function in ...
3
votes
1answer
68 views

Optimize jQuery Iteration

I have a list of elements (well, nested lists of elements, really) that the user can reorder (using jQuery sortable()). A simplified view of the structure is something like: <div ...

1 2 3 4 5 6