performance

does Google analytics make a major effect on time to download a static web page?

Hi, I understand that by simply adding a script to the end of the body tag of a html document one makes it processable by Google analytics. My question is, is this likely to have much effect on performance (download time and server load)? Let's assume a static page of say 100k served by IIS. Thanks. ...

Count rows in an SQL table in O(1)

I understand the best way to count the number of rows in an SQL table is count(*) (or equivalently count(PrimaryKey)). Is this O(1)? If not, why not? Why not just implement a counter and return it for this specific query? Is it because this query is not a common use case? If the answers vary according to SQL engine, I'd like to hear...

Follow up: How do get some of the object from a list without Linq?

I have a question about this question. I posted a reply there but since it's been marked as answered, I don't think I'll get a response to my post there. I am running C# framework 2.0 and I would like to get some of the data from a list? The list is a List<>. How can I do that without looping and doing comparaison manually o...

How do you measure code block (thread) execution time with multiple concurrent threads in .NET

Right now we just use something like this stopWatch.Start(); try { method(); } finally { stopWatch.Stop(); } Which works fine for synchronous methods, but some are executing asynchronously, so the time is skewed when multiple threads are execut...

Database and EF performance concern?

I have a basically sql select question that people gave me different answers over the years. Say I have a couple of tables designed each with over 40 columns and potentially will hold ten and thousands of row, I'm using SqlServer2005. On joining these tables, in the where clause if I have things like select * from t1, t2 where t1.User...

Asp.Net Performance Resource / book

Can you recommend a favourite resource/book for techniques and practices on writing asp.net apps that perform/scale well? ...

How long does it take for you to be comfortable with Haskell?

I'm an OK C/C++ programmer. I find Haskell very intriguing. But it seems to me, that although it's relatively easy to write clean Haskell code, as it mimics math (which I'm very comfortable with) pretty well. It's very hard to write clean code in Haskell that runs fast. A faster version of quicksort of Haskell is very long and scary, wh...

performance - single join select vs. multiple simple selects

What is better as far as performance goes? ...

Declare an object inside or outside a loop?

Is there any performance penalty for the following code snippet? for (int i=0; i<someValue; i++) { Object o = someList.get(i); o.doSomething; } Or does this code actually make more sense? Object o; for (int i=0; i<someValue; i++) { o = someList.get(i); o.doSomething; } If in byte code these two are totally equivalen...

Does anybody have any experience with SSEPlus?

SSEPlus is an open source library from AMD for unified handling of SSE processor extensions. I'm considering to use this library for my next small project and would like to know, if anybody have experience with it? Can I use it on Intel machines? Any performance issues in comparison to direct SSE calls? Any issues on 64bit machines? Wha...

C# Named parameters to a string that replace to the parameter values

Hi, I want in a good performance way (I hope) replace a named parameter in my string to a named parameter from code, example, my string: "Hi {name}, do you like milk?" How could I replace the {name} by code, Regular expressions? To expensive? Which way do you recommend? How do they in example NHibernates HQL to replace :my_param to ...

Surprising SQL speed increase

I’ve just found out that the execution plan performance between the following two select statements are massively different: select * from your_large_table where LEFT(some_string_field, 4) = '2505' select * from your_large_table where some_string_field like '2505%' The execution plans are 98% and 2% respectively. Bit of a difference ...

Mono performance

Are there any performance benchmarks for Mono compared to say Java in GNU/Linux? Have you ever tested Mono's performance? ...

What is the best way to measure execution time of a function?

Obviously I can do and DateTime.Now.After - DateTime.Now.Before but there must be something more sophisticated. Any tips appreciated. ...

Insert fail then update OR Load and then decide if insert or update.

I have a webservice in java that receives a list of information to be inserted or updated in a database. I don't know which one is to insert or update. Which one is the best approach to abtain better performance results: Iterate over the list(a object list, with the table pk on it), try to insert the entry on Database. If the insert f...

NHibernate efficiency

Having fallen behind in the world of ORM and modern data access, I'm looking to move away from DataSets (shudder) and into a proper mapping framework. I've just about got my head around Linq to SQL, an I'm now looking into NHibernate with the view to using it in our next project. With old school sql and data sets, your sql queries obvi...

Large public datasets?

I am looking for some large public datasets, in particular: Large sample web server logs that have been anonymized. Datasets used for database performance benchmarking. Any other links to large public datasets would be appreciated. I already know about Amazon's public datasets at: http://aws.amazon.com/publicdatasets/ ...

Is "Put Scripts at the Bottom" Correct?

In the Best Practices to improve web site Performance http://developer.yahoo.com/performance/rules.html, Steve Souders mentioned one rule "Move Scripts to the Bottom". It's a little confusing. Actually, I notice that a lot of web pages that doesn't put script at bottom, while YSlow still mark A for these pages. So, when should I follow...

Eclipse + PDT performance tips?

I recently wanted to get a decend IDE for my PHP side-projecs, and by searching SO found Eclipse+PDT. Although it's not quite at the level of Visual Studio yet, it's pretty nice and better than Notepad++ for this purpose. I can even debug somewhat, although it's pretty glitchy. But there is one thing that is bugging me. It seems to have...

Slow methods calls

Are methods calls really so slow or is there something wrong in my computer? static void Main(string[] args) { Stopwatch sw = new Stopwatch(); sw.Start(); for (int i = 0; i < 10000000; i++) { double z = Math.Pow(i,2); } Console.WriteLine(sw.ElapsedMilliseconds); sw = Stopwatch.StartNew(); for (int i = 0;...