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
...
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...
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...
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 ...
How are people currently profiling the performance of their ASP.NET MVC applications?
I'd be most interested in simple and free approaches.
...
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...
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...
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...
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...
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...
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...
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 ...
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.
...
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...
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.
...
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...
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 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 ...
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 ...
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...