speed

PHP Speed - Many Echos vs Building a String

Wondering if anyone knows if either of these methods would produce an output faster: Method 1 for ($i=1;$i<99999;$i++) { echo $i, '<br>'; } or Method 2 for ($i=1;$i<99999;$i++) { $string .= $i . '<br>'; } echo $string; Thanks for any input you have. ...

How to re-use a thread in Java ?

I am a building a console Sudoku Solver where the main objective is raw speed. I now have a ManagerThread that starts WorkerThreads to compute the neibhbors of each cell. So one WorkerThread is started for each cell right now. How can I re-use an existing thread that has completed its work? The Thread Pool Pattern seems to be the solut...

[Python] Tips for making a fraction calculator code more optimized (faster and using less memory)

Hello Everyone, Basicly, what I need for the program to do is to act a as simple fraction calculator (for addition, subtraction, multiplication and division) for the a single line of input, for example: -input: 1/7 + 3/5 -output: 26/35 My initial code: import sys def euclid(numA, numB): while numB != 0: numRem = numA % nu...

Building SL4 + RIAServices app takes too long on VS2010.

Got a Win7 box with VS2010 Premium installed on it. Building desktop apps works just fine. But we got this solution with 15 SL4 and 21 desktop projects... Building the SL part of it takes too long. This is very irritating and encourages to drop TDD since every time I run a test it takes ~3 seconds for msbuild to find out that nothing c...

Fastest way to pad a number in Java to a certain number of digits

Am trying to create a well-optimised bit of code to create number of X-digits in length (where X is read from a runtime properties file), based on a DB-generated sequence number (Y), which is then used a folder-name when saving a file. I've come up with three ideas so far, the fastest of which is the last one, but I'd appreciate any adv...

Fastest sorting algorithm for a specific situation

What is the fastest sorting algorithm for a large number (tens of thousands) of groups of 9 positive double precision values, where each group must be sorted individually? So it's got to sort fast a small number of possibly repeated double precision values, many times in a row. The values are in the [0..1] interval. I don't care about sp...

speed string search in PHP

Hi! I have a 1.2GB file that contains a one line string. What I need is to search the entire file to find the position of an another string (currently I have a list of strings to search). The way what I'm doing it now is opening the big file and move a pointer throught 4Kb blocks, then moving the pointer X positions back in the file and...

Is it faster to construct jQuery objects using method syntax or pure html?

Using jQuery what provides for faster object construction: With the HTML code $('<dd class="foo baz" id="bar"> foobar </dd>') Or with the pure object/method variant $('</dd>').addClass('foo').addClass('baz').id('bar').text('foobar') I'm not sure how the internals work, feel free to supply a high level summary. ...

Sort algorithm with fewest number of operations

What is the sort algorithm with fewest number of operations? I need to implement it in HLSL as part of a pixel shader effect v2.0 for WPF, so it needs to have a really small number of operations, considering Pixel Shader's limitations. I need to sort 9 values, specifically the current pixel and its neighbors. ...

Visual Studio 2010 - Is it slow for anyone else?

I've read a lot of stuff about VS2010 being much more performant than VS2008. When I've finally installed it, I found that it, in fact, is much slower (save for the Add References dialog). For instance, Silverlight projects take twice as long to load, the startup of the IDE itself is much slower, etc... Am I missing something here or ...

How to change the playing speed of videos in HTML5?

How to change the video play speed in HTML5? I've checked video tag's attributes in w3school but couldn't approach that.Any help would be appreciated! ...

Python vs. Java performance (runtime speed)

Possible Duplicate: is python slower than java/C#? Ignoring all the characteristics of each languages and focusing SOLELY on speed, which language is better performance-wise? You'd think this would be a rather simple question to answer, but I haven't found a decent one. I'm aware that some types of operations may be faster w...

When optimizing database queries, what exactly is the relationship between number of queries and size of queries?

To optimize application speed, everyone always advises to minimize the number of queries an application makes to the database, consolidating them into fewer queries that retrieve more wherever possible. However, this also always comes with the caution that data transferred is still data transferred, and just because you are making fewer...

Matlab vs. Java

How is MatLab slower than Java? Are there any ways in which it is faster? ...

Rewriting a simple Pygame 2D drawing function in C++

I have a 2D list of vectors (say 20x20 / 400 points) and I am drawing these points on a screen like so: for row in grid: for point in row: pygame.draw.circle(window, white, (particle.x, particle.y), 2, 0) pygame.display.flip() #redraw the screen This works perfectly, however it's much slower then I expected. I want to...

Is there any time estimation about sqlite3's open speed?

I am using SQLite3 in C++, I found the opening time of sqlite seems unstable at the first time (by that I mean the time to open windows and open the db at the first time). It takes a long time on 50M db, about 10s in windows, and vary on different times. Has any one met the same problem? I am writing a desktop application in windows, ...

Improve speed of a JOIN in MySQL

Dear all, I know there a similar threads around, but this is really the first time I realize that query speed might affect me - so it´s not that easy for me to really make the transfer from other folks problems. That being said I have using the following query successfully with smaller data, but if I use it on what are mildly large t...

Speed of NSScanner vs NSXMLParser?

I have an iPhone App that reads in an XML file, then pulls out the necessary data by looping through an NSScanner. The XML is not particularly long. I am wondering if it would be worth the work to implement NSXMLParser in place of using NSScanner, if I will see any real improvement in speed? ...

Optimising Database Calls

I have a database that is filled with information for films, which is (in turn) read in to the database from an XML file on a webserver. What happens is the following: Gather/Parse XML and store film info as objects Begin Statement For every film object we found: Check to see if record for film exists in database If no film rec...

PHP speed optimisation.

Hi, Im wondering about speed optimization in PHP. I have a series of files that are requested every page load. On average there are 20 files. Each file must be read an parsed if they have changed. And this is excluding that standard files required for a web page (HTML, CSS, images, etc). EG -> client requests page -> server outputs ht...