Questions tagged [performance]

Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.

Filter by
Sorted by
Tagged with
6
votes
1answer
392 views

Merging two array of classes

I have this function that should merge two array of classes when id of array1 is equal to id of array2. For simplicity I ...
4
votes
1answer
671 views

How to reduce load when fading in multiple elements in jQuery

I have a dynamic order page which has to update multiple elements when a value is changed. Here is the main function that does that. Note it only updates the values if they are different from what ...
6
votes
1answer
277 views

How to improve my auto-reconnection Python script

I need some feedback here. Due to a weird issue on my server system, the network card disconnects from the network regularly. I'll fix this at a later date. But I wanted to know if the below script ...
36
votes
9answers
12k views

Copying 80 bytes as fast as possible

I am running a math-oriented computation that spends a significant amount of its time doing memcpy, always copying 80 bytes from one location to the next, an array ...
0
votes
1answer
281 views

Is my login function secure ? how to improve it?

Using cakePHP, I would love to have your point of view about this large source code, i am not sure if its enought secure. sha1() will be removed with another script....
2
votes
1answer
23k views

jQuery Select Tabs based on URL #ID

Activating jQuery tabs from URL #id is www.somedomain.com/index.php#tab3 Given this my best shot, and it does work but I feel it could be far far better. Please tell me if this is totally shockingly ...
3
votes
2answers
2k views

Improving and optimizing Tic-Tac-Toe game written in Python 3

I've been teaching myself Python3 for about a week now and I decided to put my skills to the test by writing a simple Tic-Tac-Toe game. Here is what I came up with: ...
4
votes
2answers
2k views

Cosine simularity perfomance c#

I am using 2 nested SortedDictionaries to construct sparse matrix Here is the custom simularity(sim) function I wrote . Now it has O(n^2) complexity. I looking for suggestions to improve robustness ...
4
votes
2answers
3k views

Sieve of Eratosthenes in JavaScript

I found this method kinda tough to get for a beginner like me, but I tried to do my best, and here's what I came up with. Is this good code regarding performance? Is there anything wrong with it? <...
2
votes
2answers
8k 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 ...
5
votes
4answers
5k views

Best way to replace a beginning and end character in Perl using Regular Expression?

I'm wondering if there is a simplier regex I could use in my code to remove the beginning and ending char in a line. Maybe combine some regex's? In this instance, it's a comma at the beginning and ...
3
votes
1answer
186 views

Review for Python mapping container in which every element is a key

I wanted to have a python container in which every element is a key (like in a set), but still supports mapping (like a dict) between the elements. To get a container which supports this idea the ...
3
votes
3answers
233 views

Personal home page for a court interpreter

Could someone please review my code? It seems too convoluted. I am just starting to learn to go from blog to hosting. ...
5
votes
1answer
125 views

Module for making a doubly linked list

This module makes a doubly linked list and initializes each member. I couldn't do it with a loop, so I gave up and made each node individually. How can I improve it? Can somebody help me make a ...
1
vote
2answers
1k views

Improve on Regex replacing classnames

I am working on a small script for a mobile site. Is there any way to improve on the regex here? or remove it completely? ...
1
vote
1answer
194 views

CyberFaze app for Facebook

I had an efficiency problem like I thought and I didn't have the best solution here. My solution was \$O(n)\$ and directly a more experienced member told me a solution that is \$O(1)\$, that only ...
2
votes
2answers
2k views

PHP Dictionary class accepting objects as keys

I started creating a Dictionary class that accepts objects as there keys: ...
4
votes
4answers
337 views

Transforming a div to a widget

My first jQuery plugin is working, but I wonder if my coding is conventional. What can I do better and how can I make it more efficient? I know it's only a small plugin, so efficiency is not a big ...
3
votes
8answers
609 views

How do I make this function faster?

I have all large file of all the order sold in one week. This file gives one line for every order. We have over 5000 orders a day. It read the file line by line and then adds the sale to a database ...
3
votes
1answer
3k views

Collections.Counter in Python3

Can you suggest how I might make the following code more efficient: ...
2
votes
3answers
29k views

Inner join with first result

In SQL Server, there is two tables: Houses, and their images. I need a list with 20 houses with the first of their images (only one). I tried: ...
5
votes
1answer
192 views

Faster tests with dependency analysis

I have a performance issue causing test->code->test cycle to be really slow. The slowness is hard to avoid, since I am doing some heavy image processing, and I am trying to accelerate things a bit by ...
2
votes
2answers
98 views

Filtered log reader

I've developed a log reader which can filter it's output following a few criteria: errorlevel, product, category, id. It is functioning, but when the log file is really big, it becomes very slow, to ...
6
votes
1answer
466 views

Comparing DoublyLinkedList<T> implementation performance with other BCL (.NET) classes

I have implemented generic doubly-linked list class, which supports IEnumerable<T>,IEnumerator<T> interfaces. ...
3
votes
1answer
2k views

Koch Curve algorithm in Python without using Turtle/Logo logic

Inspired by the motivations expressed in this question. I created some code to generate the point list (and also display a pretty picture) using just analytic geometry (no Logo/Turtle, no ...
5
votes
1answer
197 views

Suggestions on how to improve this .htaccess file for page load speed

Here is my standard .htaccess file, any suggestions on how I can improve it with regards to page load speed? Would gZip instead of DEFLATE make any sort of difference? ...
1
vote
1answer
149 views

Iterating through 128-byte records in a file

I need to read records from a flat file, where each 128 bytes constitutes a logical record. The calling module of this below reader does just the following. ...
6
votes
2answers
7k views

“Deal Or No Deal”-style game in Java

This game is explained here. Could this code be more efficient? The Game Class ...
2
votes
1answer
4k views

Polling timer function in C

I've implemented a polling function with a timer in C, that every 10s checks a given condition (I've just replaced it for a log to stdout for testing purposes only) but I would like to know your ...
4
votes
1answer
2k views

Fill a DataSet with nearly 20,0000 records using SqlDataAdapter

I want to fill a DataSet with 20,0000 records using a SqlDataAdapter by using this code: ...
6
votes
3answers
3k views

Python list comparison: Can this code run faster?

The idea is to apply some function on each element in each list, then compare two lists by the value returned by the function. My current solution works but is not fast enough. running "python -m ...
3
votes
1answer
2k views

Very slow Python Combination Generator

I have the following function: ...
11
votes
5answers
4k views

T-SQL statement to breakdown UserAgent information

I have a table that contains the UserAgent string and a Count of how many times its seen. The T-SQL below is used to give a ...
4
votes
4answers
3k views

File parsing code in C++

I'm processing about 3.5gb/15minutes, and I was wondering if I could get this down to a better time... Note that this is for a very specific CSV file, so I am not concerned about generality - only ...
2
votes
1answer
2k views

Optimization of region of interest (ROI) drawing in the image

I'm drawing rectangular ROI region by darkening the area outside of it as in this image: But image.MakeTransparent takes too much time. What is the best way to ...
2
votes
1answer
202 views

PHP performance considerations of passing variable into a function

Example code: ...
-1
votes
2answers
200 views

Displaying posts

I am trying to create a new website, and i am using a class that has many functions on it. First i want to say that my class has about 5000 rows , is this a problem ? The main function i have used ...
6
votes
1answer
2k views

Optimizing Huffman Decoding

I've been working on implementing a fast Huffman decoder for video decoding. With some help from you, I have been able to produce a decent implementation. However I am still not satisfied with the ...
1
vote
1answer
187 views

Encode strings by subtracting one from each character code

I currently have this encoding function which simply subtracts one from each character code: ...
12
votes
3answers
3k views

Huffman decoding for video

I've been trying to implement a fast Huffman decoder in order to encode/decode video. However, I'm barely able to decode a 1080p50 video using my decoder. On the other hand, there are lots of codecs ...
5
votes
2answers
21k views

Cash-withdrawal from an ATM

I'm seeking review comments (design, performance, etc.) based on the problem statement: Write a CashWithDrawal function from an ATM which based on user specified amount dispenses bank notes. ...
16
votes
2answers
1k views

Python Manga Image Viewer

I'm currently making a manga (read: comic) viewer in Python. This project has been a code-as-you-learn project, because I have been trying to code this as I learned about Tkinter. Python I have known ...
2
votes
6answers
4k views

Quadrant Queries challenge

Running the same test 10,000 times with cProfile tells me that most of the damage happens in the count() function. This is my attempt at a solution to the Quadrant Queries challenge from ...
3
votes
1answer
3k views

JavaScript: Weighted Random Generator

I'm attempting to create a function that will give me a "fish" at random, though a bias random depending on the weight value for the "fish". ...
2
votes
1answer
2k views

Slow mutable priority queue

I needed a mutable priority queue (the priorities can be changed) for my currect project, and started by simply wrapping a class around a std::vector and make/push/...
7
votes
3answers
4k views

Connection pool in Java

Please review this connection pool. I tested it and it works but can we improve it from design or performance perspective? ...