speed

How to diagnose .htaccess speed issues via RewriteLog

We have .htaccess setup to handle URLs like: http://www.oursite.com/events/Health/Insectology/343/346.html But clicking from such a generated page to: http://www.oursite.com/events/Anything/Anything/abc/abc.html Seems to reload the page completely (and not use the cached images). (This question is related to http://stackoverflow.c...

Char* vs String Speed in C++

I have a C++ program that will read in data from a binary file and originally I stored data in std::vector<char*> data. I have changed my code so that I am now using strings instead of char*, so that std::vector<std::string> data. Some changes I had to make was to change from strcmp to compare for example. However I have seen my execut...

Why is PyQt application startup so slow?

C++ is fast. Qt is fast. Python interpreter startup is relatively fast (2-3 seconds on my computer). PyQt is thin wrapper around Qt. Why then PyQt app startup (about 80 lines, even in .pyc form) is so slow (6-12 seconds)? I'm interested in reasons for this and, most importantly, ways to improve this situation. ...

php's preg_replace() versus(vs.) ord() .

What is quicker, for camelCase to underscores; using preg_replace() or using ord() ? My guess is the method using ord will be quicker, since preg_replace can do much more then needed. <?php function __autoload($class_name){ $name = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $class_name)); require_once("some_dir/".$nam...

Is there a way to boost the speed of Ti.UI.TableView in Titanium for custom rows?

I'm using Titanium's appcelerator. I've seen the kitchensink example for tableView performance, but that's just for un-customized rows, at around 4ms a row on my 1G iPhone. The performance for 1.4.0 and 1.4.1.1 shoots up considerably when you have custom rows, like one with a picture and a label, to about 20ms per row at the very least. ...

Speed up NumPy loop

I'm running a model in Python and I'm trying to speed up the execution time. Through profiling the code I've found that a huge amount of the total processing time is spent in the cell_in_shadow function below. I'm wondering if there is any way to speed it up? The aim of the function is to provide a boolean response stating whether the s...

Sum one row of a NumPy array

I'd like to sum one particular row of a large NumPy array. I know the function array.max() will give the maximum across the whole array, and array.max(1) will give me the maximum across each of the rows as an array. However, I'd like to get the maximum in a certain row (for example, row 7, or row 29). I have a large array, so getting the...

Limit download speed using PHP

I found on Google some PHP scripts to limit the download speed of a file, but the file download at 10 Mbps or if it download at 80 kbps as i set it, after 5 mb, it stops downloading. Can some one tell me where I can found a good PHP download speed limit script please? Thank you very much --- Edit --- Here is the code : <?php set_tim...

how do you prove that the big theta of a series is its leading term?

if f(x) = (An) x^n + (An-1) x^(n-1) +...+ (A1)x + (A0) how can you prove f(x) is big theta(x^n). I've thought about it and one could do it by proving that f(x) big O(x^n) and x^n big O(f(x)). I've figured out the proof for the former (using triangle inequality) but could not understand how to do the latter. Alternatively one could prov...

In MySQL, is it faster to delete and then insert or is it faster to update existing rows?

First of all, let me just say that I'm using the PHP framework Yii, so I'd like to stay within its defined set of SQL statement if possible. I know I could probably create one huge long SQL statement that would do everything, but I'd rather not go there. OK, imagine I have a table Users and a table FavColors. Then I have a form where us...

logging visitors online for large traffic website.

Hi, I manage a rather large traffic website. On each page we keep track of a visitors online by running the following code. We then have a cron which deletes the records which are older than X minutes. if(!isset($_SESSION[users_online_id])) { if(!(date('H')=='02' && date("i") >= 37 && date("i") <= 45)) { # NEW VISITOR - DOESN'T HAVE...

how to increase the speed of R CMD build when directory contains large unassociated files?

I have a R package in the directory ~/package; I also keep the output from my use of the package in the directory ~/package/out. When the content of ~/package/out gets very large, it takes minutes instead of seconds to build this package. Is there a way to have "R CMD build package" ignore the ~/package/out directory? ...