speed

Quicker ways to search a C# List<String>

I currently have a list called regkey and a string called line_to_delete, which I obviously want to delete from the list. At the moment I'm searching through one element of the list at a time creating substrings as line_to_delete only represents part of the line that I want to delete but is uniquely identifiable within the list. Anyway ...

Speeding Up the First Page Load in django

When I update the code on my website I (naturally) restart my apache instance so that the changes will take effect. Unfortunately the first page served by each apache instance is quite slow while it loads everything into RAM for the first time (5-7 sec for this particular site). Subsequent requests only take 0.5 - 1.5 seconds so I woul...

Which mysql select is better/faster?

Is there a preferred way? There are currently 1640 rows in the game table to go through and will be adding about 1200 every year. SELECT `date` FROM `game` WHERE `date`<'2009-11-09' ORDER BY `date` DESC LIMIT 1; 0.0004 seconds SELECT MAX(`date`) AS `date` FROM `game` WHERE `date`<'2009-11-09' LIMIT 1; 0.0006 seconds The speeds we...

Which multilingual web design solution is fastest for the user, if this is indeed an issue?

Context: I'm in the design phase of what I'm hoping will be a big website (lots of traffic, lots of users reading and writing to database). I want to offer this website in the three languages I speak myself (English, French, and by the time I finish the website, I will hopefully have learned enough Spanish to offer that too) Dilemma: ...

Firefox and Chrome slow on localhost; known fix doesn't work on Windows 7

Firefox and Chrome are known to be slow on localhost when IP6 is enabled. In previous versions of Windows, the simplest fix is to comment out this line from the hosts file, as explained in the answer to this question. ::1 localhost However, as noted in this question, in Windows 7 this line is already commented out: # localhost name r...

What is more efficient in python new array creation or in place array manipulation?

Say I have an array with a couple hundred elements. I need to iterate of the array and replace one or more items in the array with some other item. Which strategy is more efficient in python in terms of speed (I'm not worried about memory)? For example: I have an array my_array = [1,2,3,4,5,6] I want to replace the first 3 elements ...

How to change the default parameters for newfit() in MATLAB?

I am using net = newfit(in,out,lag(j),{'tansig','tansig'}); to generate a new neural network. The default value of the number of validation checks is 6. I am training a lot of networks and this is taking a lot of time. I guess it doesn't matter if my results are a bit less accurate if they can be made considerably faster. How can ...

(PHP) Validation, Security and Speed - Does my app have these?

Hi all, I am currently working on a building community website in PHP. This contains forms that a user can fill right from registration to lot of other functionality. I am not an Object-oriented guy, so I am using functions most of the time to handle my application. I know I have to learn OOPS, but currently need to develop this website ...

What is faster on division? doubles / floats / UInt32 / UInt64 ? in C++/C

Hi everyone, I did some speed testing to figure out what is the fastest, when doing multiplication or division on numbers. I had to really work hard to defeat the optimiser. I got nonsensical results such as a massive loop operating in 2 microseconds, or that multiplication was the same speed as division (if only that were true). After...

Same MySQL query takes 0.3 sec in MyPHPAdmin, 7.9 sec in PHP -- Why?

I am running the following MySQL query: select * from combinations where family_type='f597'; on a table that has about 90,000 lines. If I run the query via MyPHPAdmin, it takes 0.3 seconds to run, but in my php page on the same host it consistently takes about 8 seconds. To test the amount of time it takes in my page, I run it like ...

Most important speed issues

I am participating in Al Zimmermann's Programming Contest. http://www.azspcs.net/Contest/SonOfDarts I have written a recursive algorithm but it takes a long time to run. I was wondering what are the most important things to consider about speed of recursive algorithms. I have made most of the properties global so they don't get all...

Should one use PHP to print all of a page's HTML?

Hi So I've always developed PHP pages like this: <?php goes at the top, ?> goes at the bottom, and all the HTML gets either print()ed or echo()ed out. Is that slower than having non-dynamic html outputted outside of <?php ?> tags? I can't seem to find any info about this. Thanks! --Mala UPDATE: the consesus seems to be on doing it my ...

Anyone have benchmarks / speed tests comparing Classic ASP vs ASP.NET 2.0 or 3.5?

I'm thinking about using ASP.NET in a new project I'm starting and I'm wondering if it's faster than classic ASP. I've been using classic for years, and never ran into any problems, but I really want to pick the fastest out of the three. Thanks for your help! ...

Why is using a static int in my accelerometer callback so much slower than using an instance variable?

I'm playing with the GLGravity example to figure out some of the performance nuances related to dealing with the accelerometer. Here's the problem code: - (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration { static int accelCallCount; accelCallCount++; if (accelCallCount % 100 ==...

Is speed control over music on an iPhone plausible?

I'm writing an iphone app, and I would like to have the user able to slow or quicken a pre-made sound file. Is this possible? If so, how would you do it? Edit: This looks like a dup of the following post: http://stackoverflow.com/questions/1191313/iphone-sound-adjust-speed-of-playback-of-audio-file-while-playing ...

Functions too fast? So they get skipped?

Hi all, With a function a div-popover gets called and filled with dynamic data using Ajax, PHP, MySQL and some HTML/CSS. All goes fine. When I want to delete an entry in the list just popped over it functions as it should. When I send an update request for my list it also goes the way I want it. But, when i call delete(); update(); rig...

printf slows down my program

I have a small C program to calculate hashes (for hash tables). The code looks quite clean I hope, but there's something unrelated to it that's bugging me. I can easily generate about one million hashes in about 0.2-0.3 seconds (benchmarked with /usr/bin/time). However, when I'm printf()inging them in the for loop, the program slows dow...

artificial slowdown

Hi everyone, I've got a flash clip that is known to behave weird if user has slow internet. Now I want to troubleshoot that. Is there a way to slowdown the load speed? Preferably with local apache or may be even with firefox only. ...

Calculating point of intersection based on angle and speed

I have a vector consisting of a point, speed and direction. We will call this vector R. And another vector that only consists of a point and a speed. No direction. We will call this one T. Now, what I am trying to do is to find the shortest intersection point of these two vectors. Since T has no direction, this is proving to be difficult...

writing to GUI issue

hello, So i have a setup where two imacs, imac_1 and imac_2, are connected through firewire. imac_1 sends some debugging information to imac_2 and on imac_2 i have a program in c++ that captures debugging information.(see illustration below) Now the problem is that if i write the debugging info to the GUI (created using QT) directly i...