Tagged Questions

Questions related to improving application performance.

learn more… | top users | synonyms

1
vote
0answers
20 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
104 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
1answer
42 views

php script to get field type 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
30 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
123 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
39 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
43 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
88 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
57 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
150 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
42 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
42 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
63 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
98 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
68 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
49 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
35 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
69 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
90 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
130 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
120 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 ...
3
votes
2answers
438 views

How can I improve the performance of this code?

I was solving the Find the Min problem on facebook hackercup. The code below works fine for the sample inputs given there, but for input size as big as 10^9 this takes hours to return the solution. ...
12
votes
5answers
341 views

Naive C++ Matrix Multiplication 100 times slower than BLAS?

I am taking a look at large matrix multiplication and ran the following experiment to form a baseline test: Randomly generate two 4096x4096 matrixes X, Y from std normal (0 mean, 1 stddev). Z = X*Y ...
1
vote
0answers
60 views

Sudoku Valid Arangements Permutations Enumerator

I wondered if anyone has any ideas to make this cleaner or more efficient. Mostly this was an exercise to generate the data once (So speed really isn't too important, but I'd love to see what ...
4
votes
1answer
81 views

Python Adventure . In need of debugging and improvement finding

I'm a python coder [beginner] and this is the first program that i have ever programmed. Please suggest improvements/bugs Here's the link to the code : PythonProgram global hp hp = 20 global dice ...
2
votes
3answers
105 views

Searching item in array

I have a program that calculates some values and saves them to an array. Before save a value, program checks if there is already an identical value in array: string someData = GetData(); bool ...
2
votes
1answer
154 views

Generated Code Proxy

In my library Transfuse I use a code generator to build a handful of classes that look up resources. Each of these look up classes are proxied by a static utility class so they may be referenced ...
1
vote
1answer
74 views

Initialize a bunch of NSDateComponents objects at once (in a loop)?

I'm developing an iPhone app that is heavily Calendar-based, and it requires a good amount of (what I'm calling) "date boundaries." I use these "date boundaries" to fetch EKEvents from specific ...
8
votes
3answers
224 views

Please review my exercise about linked lists

I'm learning C++ by myself and therefore I have no direct access to a mentor. This is the reason why I'd love if you guys could take the time to do a peer code review. I am very much aware, as per ...
2
votes
2answers
69 views

Reduce program runtime in java - Making a code faster

import java.util.Scanner; class main{ public static void main(String args[]){ Scanner input = new Scanner(System.in); int n,k,m=0; n = input.nextInt(); k = input.nextInt(); ...
0
votes
2answers
50 views

What is the efficient way to create an array of associative arrays in PHP?

I am fetching rows from the DB and returning the result in JSON. The output needs to be an array of associative arrays. The way I achieve this is: $i = 0; foreach($resultSet as $r) { ...
0
votes
2answers
86 views

Correct way of using HBRUSHes..?

If I create a brush like so HBRUSH hBrush = CreateSolidBrush(RGB(33, 33, 33)); and then later on, I want to change the color of the brush, how would I do this? I googled a bit and found out that ...
2
votes
1answer
140 views

How can I improve my matrix multiplication?

I am working on a sparse matrix application in C and I choose compressed sparse row(CSC) and compressed sparse column(CSC) as my data structure for it. But the difficult part is I cannot improve my ...
2
votes
2answers
91 views

A* shortest path algorithm optimization request

Good day to ya'll. I had this programming excericise of mine where I had to find the shortest path to an exit in an NxM -grid maze in under a second (both N and M would be anywhere between 3 and ...
1
vote
2answers
160 views

What design pattern to use on this case

I have this code that converts audio to different file formats. import java.io.File; import it.sauronsoftware.jave.AudioAttributes; import it.sauronsoftware.jave.Encoder; import ...
1
vote
2answers
97 views

simplify and improve performance of getting data

I am working on a little browsergame project written in PHP and using PostgreSQL as DBMS. Now I'm not really lucky with the process started after a userlogin was succesful. Some info: there are 3 ...
7
votes
0answers
176 views

Improving the Java UUID class performance

I am looking to submit the following code (adapted to fit into java.util obviously) which significantly improves performance and reduces useless allocations of java.util.UUID. Help me find the bugs ...
2
votes
5answers
188 views

Does this code contain any hidden bugs, performance issues?

This is a piece of C89 code testing a function titled 'logging_function', which takes two arguments and uses them to log a bit of information. In this case, the first argument to the function is the ...
2
votes
1answer
146 views

How can I make this code (that is usually in a loop) faster and efficiently?

When I have a place with limited space, where I entry a text that can be few letters or huge amount of text because it's dynamic, I'm using this code to make the text fit the specific space. #region ...
9
votes
3answers
393 views

How to do efficient string concatenations in JS?

I form DOM nodes as strings and append them to DOM tree like below using jquery. var dom = '<div><div style="display: inline-block">first name</div>' '<div ...
4
votes
1answer
80 views

Edge finding binary search

Imagine a website that publishes the number of daily commuters in only a graphical form each day using a bar chart. I want to determine the number by reading the bar chart after saving the graphic as ...
4
votes
3answers
198 views

How to improve wordfeud solver algorithm?

I created a simple wordfeud solver that checks what words can be created with the supplied letters. public void GetResults(string characters) { // place all the characters we have in a dictionary ...
2
votes
3answers
162 views

Is there a faster way to clear the screen?

I'm currently clearing my console window with this piece of code: void clrScr() { COORD cMap = { 0, 3 }; if(!FillConsoleOutputAttribute(hCon, 0, 2030, cMap, &count)) { ...
2
votes
0answers
103 views

Inverted index in Clojure - performance vs. idiomatic code

I have this code to create an inverted index from a directory of text files: (def p (re-pattern #"[^\p{L}&&[^\p{M}]]")) (defn invert[file] (let [f (.getName file) tokens (.split p ...
0
votes
0answers
71 views

Shuffling algorithms by a Clojure Novice

The shuffle descriptions can be seen here... Shuffling Am I using Clojure idioms and going with the grain of the language? A few things that concern me.. Am I doing too much logic in my let ...
1
vote
1answer
55 views

Optimize nested enumerate blocks?

Well, i have 3 nested NSEnumeration loops, used to get the textfields of a custom cell, in a custom table in a custom view in a controller... How can i change this code to make more readable and more ...
5
votes
1answer
104 views

First Go at Clojure and Functional Programming in General

Here's the code... My goal is to simulate a Pile shuffle of a vector. Here's the function.. (defn pile ([cards] (pile cards 3 1)) ([cards num_piles] (pile cards num_piles 1)) ([cards ...
2
votes
0answers
40 views

Low performance of PL/pgSQL function

I have a PL/pgSQL function which is unstable. This is source: DECLARE l RECORD; events_for_machine integer; before_event "PRD".events_log; machines_ids integer[]; island_controller RECORD; ...
1
vote
1answer
65 views

Using java keyword final on reference objects inside methods body [closed]

As per Joshua Bloch's book "Effective Java", Item 15 - Minimize mutability, using final keyword on private class fields in addition to immutability and thread-safe syncing could improve performance. ...
8
votes
2answers
181 views

String join of distinct string

I have a class like this one: class EmailClass { public string MailAdresse { get; set; } public string MailAdresseCC { get; set; } } Through a JSON deserialization I obtain a ...

1 2 3 4 5