performance

any faster alternative??

cost=0 for i in range(12): cost=cost+math.pow(float(float(q[i])-float(w[i])),2) cost=(math.sqrt(cost)) Any faster alternative to this? i am need to improve my entire code so trying to improve each statements performance. thanking u ...

Hadoop: Processing large serialized objects

I am working on development of an application to process (and merge) several large java serialized objects (size of order GBs) using Hadoop framework. Hadoop stores distributes blocks of a file on different hosts. But as deserialization will require the all the blocks to be present on single host, its gonna hit the performance drasticall...

python threading and performace?

I had to do heavy I/o bound operation, i.e Parsing large files and converting from one format to other format. Initially I used to do it serially, i.e parsing one after another..! Performance was very poor ( it used take 90+ seconds). So I decided to use threading to improve the performance. I created one thread for each file. ( 4 threa...

What should I use to increase performance. View/Query/Temporary Table

I want to know the performance of using Views, Temp Tables and Direct Queries Usage in a Stored Procedure. I have a table that gets created every time when a trigger gets fired. I know this trigger will be fired very rare and only once at the time of setup. Now I have to use that created table from triggers at many places for fetching ...

ASP.NET MVC Application performance profiling

How are people currently profiling the performance of their ASP.NET MVC applications? I'd be most interested in simple and free approaches. ...

Is there a good guide to interpreting the Firebug net panel?

I’m using the Net panel in Firebug to evaluate the performance of web pages I’m writing. Specifically, I’m wondering what the precise meaning is of the stages for each resource that’s downloaded (i.e. DNS lookup, Connecting, Blocking, Sending, Waiting, receiving). But more generally, is there a Firebug guide where I can look this stuff...

Application hangs or collapses on submitting the data in the sign-up form, second time...First time it run perfectly.....

Hi, below is the code of a sign up form, when we CLICK second time to submit the entered details, the application collapses and hags just displaying the dialog_thread....On executing very first time it rum perfectly..............The code of dialog_thread is given after onClick()....Please help me, how to get rid of this problem and let...

SQL Server lock/hang issue

Hi, I'm using SQL Server 2008 on Windows Server 2008 R2, all sp'd up. I'm getting occasional issues with SQL Server hanging with the CPU usage on 100% on our live server. It seems all the wait time on SQL Sever when this happens is given to SOS_SCHEDULER_YIELD. Here is the Stored Proc that causes the hang. I've added the "WITH (NOLOCK...

Postgresql performance on EC2/EBS

What gives best performance for running PostgreSQL on EC2? EBS in RAID? PGData on /mnt? Do you have any preferences or experiences? Main "plus" for running pgsql on EBS is switching from one to another instances. Can this be the reason to be slower that /mnt partition? PS. im running postgresql 8.4 with datas/size about 50G, amazon ec2...

HttpURLConnection inside a loop

Hi! I'm trying to connect to one URL that I know that exist but I don't know when. I don't have access to this server so I can't change anything to receive a event. The actual code is this. URL url = new URL(urlName); for(int j = 0 ; j< POOLING && disconnected; j++){ HttpURLConnection connection = (HttpURLConnection) url.openConnec...

Performance of Managed C++ Vs UnManaged/native C++

I am writing a very high performance application that handles and processes hundreds of events every millisecond. Is Unmanaged C++ faster than managed c++? and why? Managed C++ deals with CLR instead of OS and CLR takes care of memory management, which simplifies the code and is probably also more efficient than code written by "a pro...

Should I go with Varnish instead of nginx?

I really like nginx. But recently I've found that varnish gives you an opportunity to implement smart caching revers proxy layer(with URL purging). I have a cluster of mongrels which are pretty resource-intensive so if this caching layer can remove some load from mongrels this can be a great thing. I didn't find a way to implement the ...

C++: Is it good practice to make getters and setters inline?

Hi, The title says it all. public: inline int GetValue() const { return m_nValue; } inline void SetValue(int nNewValue) { this -> m_nValue = nNewValue; } On Learn C++, they said it would run faster. So, I thought it would be great. But maybe, there are some negative points to it. ...

Selective SSL with .htaccess force http:// or https://

I am trying to be more selective in which pages/requests are using SSL for performance reasons. I would like to use htaccess to redirect to https:// for only the required pages and redirect back to http:// for everything else. This is what I have: RewriteEngine On # force https RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)/(abc|x...

Benchmarking a particular method in Objective-C

I have a critical method in an Objective-C application that I need to optimize as much as possible. I first need to take some easy benchmarks on this one single method so I can compare my progress as I optimize. What is the easiest way to track the execution time of a given method in, say, milliseconds, and print that to console. ...

C99 variable length automatic array performance

Is there significant cpu/memory overhead associated with using automatic arrays with g++/Intel on 64-bit x86 linux platform? int function(int N) { double array[N]; overhead compared to allocating array before hand (assuming function is called multiple times) overhead compared to using new overhead compared to using malloc The r...

why use the "!!!"?

as follow codes: var a = {}; if(!!!a[tabType]){ a[tabType] = []; a[tabType].push([self,boxObj]); }else{ a[tabType].push([self,boxObj]); } i think !!!a[tabType] equals !a[tabType] why use the "!!!" not "!" ? thank you! ...

Does SetFileBandwidthReservation affect memory-mapped file performance?

Does this function affect Memory-mapped file performance? Here's the problem I need to solve: I have two applications competing for disk access: "reader" and "updater". Whole system runs on Windows Server 2008 R2 x64 "Updater" constantly accesses disk in a linear manner, updating data. They system is set up in such a way that updater ...

Can I use memcpy in C++ to copy classes that have no pointers or virtual functions

Say I have a class, something like the following; class MyClass { public: MyClass(); int a,b,c; double x,y,z; }; #define PageSize 1000000 MyClass Array1[PageSize],Array2[PageSize]; If my class has not pointers or virtual methods, is it safe to use the following? memcpy(Array1,Array2,PageSize*sizeof(MyClass)); The reason I ...

PHP script keeps doing mmap/munmap

Hello, My PHP script contains a loop, which does nothing much more than echoing and dereferencing pointers (like in $tab[$othertab[$i]]-> stuff). It was working great until yesterday, when this script starting being VERY slow (like 50 times slower than before). After using strace, i figured out that 90% of the time, the script does m...