Questions related to improving application performance.
3
votes
0answers
24 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) ...
2
votes
1answer
58 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 ...
1
vote
2answers
68 views
Performance: Devide group of numbers into two groups of which the sums are equal
I have a piece of code that devides 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
45 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
45 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
92 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
165 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
58 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
252 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
76 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
161 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
40 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
115 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
94 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 ...
3
votes
2answers
108 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
70 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
43 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
89 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
36 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
167 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
109 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
91 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
92 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
43 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
169 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
66 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
179 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
50 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
49 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
111 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
169 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
55 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
67 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 ...
2
votes
4answers
108 views
Remove code duplication inside of a loop preserving performance
I'm coding a 2D collision engine, and I need to merge adjacent axis-aligned bounding boxes depending on a direction (left, right, top, bottom).
The four cases are very similar, except for the if ...
0
votes
2answers
72 views
How to optimize this?
This is a user Javascript for youtube, the point is to make the thumbnail bigger on mouseover, I just want some help making it better because I don't want it to waste resources with all the extensions ...
-1
votes
1answer
55 views
Project RGB with Switches [closed]
I am working on project in which I need to display different colors
on RGB led. I am using pwm to drive different colors on LED. My Pic
is PIC24FJ64GA004 with which I am working on now. Basic concept ...
1
vote
0answers
37 views
Creating and referencing markup…cloning, etc. efficient system for this plugin
I am pulling multiple feeds from youtube that have a callback function which makes markup from each feed. They add that markup to a documentFragment stored in var data. When all the feeds have ...
1
vote
3answers
97 views
Using levenstein distance to compare strings, works but produces many false positives before real solution is found
My overall challenge and why this code was written was to compare two strings. One string being a description of a item in inventory and one string being a description of a item, but possibly ...
3
votes
1answer
112 views
JS/Jquery newbie here… Can I please get some advice on improving my code?
You can see the JS at the end of this post in action here at http://andrew-oh.com/portfolio/timeline/ (It's responsive!)
I've recently picked up javascript/jquery and would love some feedback on how ...
1
vote
0answers
137 views
How to add faster object to an array
I have a list with contentlets and want all languages from every contentlet (I get these with the method languageAPI.getAllValuesByKey(key , contentList). I get a Hashmap and iterate over it. There ...
0
votes
0answers
135 views
How to make a iteration in a for loop faster
I have a list with contentlets and want all languages from every contentlet (I get these with the method languageAPI.getAllValuesByKey(key , contentList). I get a Hashmap and iterate over it. There ...