speed

Efficiency of explicit initialization

I have a class which has a constructor that takes a const char*. It is: c::c(const char* str) { a = 32; f = 0; data = new char[strlen(str)]; memcpy(data, str, strlen(str)); } And a function which takes one of them: int foo(c& cinst); You can call this function either by passing it an instance of a c: c cinst("asdf"...

Ternary operator ?: vs if...else

In C++, is the ?: operator faster than if()...else statements? Are there any differences between them in compiled code? ...

CSS - Optimizing rounded corners for speed

I'm trying to optimize my site for speed. I used images for the rounded corners before but now I've changed them with border-radius and -moz-border-radius css rules. Which way is the best for speed? I used to think that css rules are faster but I've seen a lot of sites talking about css sprites and I'm a bit confused now. Oh and I don't ...

PHP why is echo faster than print

In PHP, why is echo faster than print They do the same thing... Why is one faster than the other? Do they do exactly the same thing??? ...

How to speed up single (last) migration test?

I'm writing my migration SQL against tests. Because the migration is the last one and we've got about 300 migrations, it's DAMN SLOW to get there, as it migrates from bottom up every time. Any ideas how to speed this up a bit? ...

Which methods do you prefer to test the speed of your Javascript, and why?

I was simply wondering what methods folks are using to test their javascript's execution speed and look out for performance bottlenecks, whether they simply be code snippets or services. I'd also like to know why you would advocate this method. Flexibility? Simplicity? Or perhaps there is a single, right way. Whatever it is, I'm looking...

On a stats-system, should I save little bits of information about single visit on many tables or just one table?

Hello I've been wondering this for a while already. The title stands for my question. What do you prefer? I made a pic to make my question clearer. Why am I even thinking of this? Isn't one table the most obvious option? Well, kind of. It's the simpliest way, but let's think more practical. When there is a ton of data in one table a...

MySQL speed question

I have two mysql db on one machine. db1 and db2. If db1 is intensive in use, is querys for db2 wait for db1 querys finish? in other words is mysql use paralell computing for querys in different databases? For example big query1 comes to db2. It computes 5 seconds. And after 1 sec comes little query2 for db1, it computes 1 second. Will q...

What loop is faster, while or for

You can get the same output with for and while loops: WHILE $i = 0; while ($i <= 10){ print $i."\n"; $i++; }; FOR for ($i = 0; $i <= 10; $i++){ print $i."\n"; } But which one is faster? ...

duplex wcf service data transfer speed in IIS

I have a web service which sends messages back to the client via callback interface. The messages are sent on a different thread. The performance is pretty good when the service is self-hosted. However, when hosted in II5, the messages are sent at slower speed. For example, on a self-hosted service, it takes 0.2s to send a 200KB messag...

Speed Comparison and suggestion for wise case in Matlab

Case 1: I have a nested for loop to run large realizations and save variables generated through that loop in .mat files, which I can later use in another program. Case 2: I can make the function of the above mentioned loop and call it directly in the other program where I want to use the variables generated by the above loop. The only...

Which is faster - A Using block or Try/Catch/Finally

This is a followup question to this Should I stick with the Try/Catch/Finally construct, or go with the Using construct? Sample Code for Try/Catch/Finally: Dim oRequest As WebRequest Dim oResponse As HttpWebResponse = Nothing Dim dataStream As Stream = Nothing Dim reader As StreamReader = Nothing Dim responseFromServer As String Try ...

Fastest data structure for inserting/sorting

I need a data structure that can insert elements and sort itself as quickly as possible. I will be inserting a lot more than sorting. Deleting is not much of a concern and nethier is space. My specific implementation will additionally store nodes in an array, so lookup will be O(1), i.e. you don't have to worry about it. ...

Boost.Python function pointers as class constructor argument

I have a C++ class that requires a function pointer in it's constructor (float(*myfunction)(vector<float>*)) I've already exposed some function pointers to Python. The ideal way to use this class is something like this: import mymodule mymodule.some_class(mymodule.some_function) So I tell Boost about this class like so: class_<Some...

how to make the execution time less(ie. a faster code) for this problem

this question is from Codechef.com [if anyone is still solving this question dont look further into the post before trying yourself] and although it runs right, but i need to make it a lot faster.i am a beginner in c,c++.(i know stuff upto arrays,strings and pointers but not file handling etc).So is there a way to make this program run a...

Is there an MS Test Runner that is faster

MS Test is killing me. It is so slow compared to NUnit. I am stuck with it because I need to be able to get Test Results into TFS easy. (Plus it works better with Pex and I am using that too). But I would really like it to go faster. Even just a bit faster would be nice. Has anyone made a test runner for MS Test tests that goes fas...

Objective test: ASP.NET vs Google Web Toolkit

Hi, I was wondering if there were any tests out there that compared page loading times for identical websites constructed in either asp.net or gwt. Have had a look but nothing as objective as this seems to be about... ...

what is slower or what is faster in PHP: if( @$myvar['test'] === null ) or if( !isset( $myvar['test'] ))

I wonder what is slower or faster: if( @$myvar['test'] === null ) { .. } or: if( !isset( $myvar['test'] )) { .. } Also wondering if you suppress a warning or notice with @, will it make the evaluation slower? Thanks for your answer! PS: It is not about the difference, i know that isset checks if a element is set and not if it is ...

What is the fastest bzip2 decompressor?

Hello. Which implementation of bzip2 have the biggest decompression speed? There is a http://bitbucket.org/james_taylor/seek-bzip2/src/tip/micro-bunzip.c which claims Size and speed optimizations by Manuel Novoa III ([email protected]). More efficient reading of huffman codes, a streamlined read_bunzip() function, and va...

Speed Up XML Queries in SQL Server 2005

I store all my data in on XML column in SQL Server 2005. As more and more records are being inserted, I notice the queries are slowing down. I've tried creaeting a Primary XML Index, as well as a Secondary VALUE index and this did not do anything to help the speed. Any tips,thoughts, or tricks that I'm missing? Sample View that I que...