performance

Speed of multiple variable assignment in T-SQL

Imagine I have a chunk of initialisation code at the top of a stored procedure with a number of variable assignments: SET @proc = 'sp_madeupname' SET @magic_number = 42 SET @tomorrows_date = DATEADD(dd, 1, GETDATE()) ... Clearly doing all of the above as one SELECT would be faster: SELECT @proc = 'sp_madeupname' ,@magic_numb...

How do I use micro-state accounting in Linux?

I would like to access micro-state accounting timers programmatically on Linux. I guess the first part of the question is where are these available? Which kernel versions and distros? Which hardware platforms? The second part is how to actually go about accessing the timers? What is the system call? Here is a (somewhat old) page describ...

When is loop unwinding effective?

Hi all, Loop unwinding is a common way to help the compiler to optimize performance. I was wondering if and to what extent the performance gain is affected by what is in the body of the loop: number of statements number of function calls use of complex data types, virtual methods, etc. dynamic (de)allocation of memory What rules (of...

Recommended placement of tempdb and log for SQL Server OLTP database(s)

Suppose the following configuration: Drive D ... Data, Drive E .... TempDB, Drive F ... Log. and suppose all drives are on separate spindles with respective drive controllers. Concerning performance; is the above configuration optimal, decent, or not advisable? With budgetary constraints in mind, can any of these DB's share the save dr...

DataTable + DataGrid Data Binding Performance Againsts Custom Data Source Object + Data Grid

In our industrial automation application, we need to capture and display the data in the milliseconds. We have data binding between data grid control and a DataTable object. We have around three hundred records which needs to be display in the grid. So we update the 300 records every time we get the records. Example TabularVi...

Insert Into: Is one syntax more optimal or is it preference?

SQL Server (2005/2008) Each of the below statements have the same result. Does anyone know if one outperforms the other? insert into SOMETABLE values ('FieldOneValue','FieldTwoValue',3,4.55,'10/10/2008 16:42:00.000') insert into SOMETABLE select 'FieldOneValue','FieldTwoValue',3,4.55,'10/10/2008 16:42:00.000' insert into SOMETA...

What is your best/funniest/annoying performance tuning experience?

Often we find changing a few lines of code makes n-fold performance increases in applications. One such experience for me was fixing an issue in the configuration library. The library was based on XML configuration file and XPath was used to access the configuration. During profiling, I found an enormous number of XPath objects and call...

What language/platform would you recommend for CPU-bound application?

I'm developing non-interactive cpu-bound application which does only computations, almost no IO. Currently it works too long and while I'm working on improving the algorithm, I also think if it can give any benefit to change language or platform. Currently it is C++ (no OOP so it is almost C) on windows compiled with Intel C++ compiler. ...

How do you optimise your Javascript ?

Well... simple question, right? But with no so simple answers. In firefox i use firebug console (profile) but... what to do in other browsers? Like Internet Explorer / Opera / Safari (on windows) ...

NTFS performance and large volumes of files and directories

How does Windows with NTFS perform with large volumes of files and directories? Is there any guidance around limits of files or directories you can place in a single directory before you run into performance problems or other issues? e.g. is a folder with 100,000 folders inside of it an ok thing to do ...

Framerate limit for wpf apps?

hi there, i wonder if there is a way to limit the wpf framerate within a process? i.e. i do not want to limit a single animation's framerate, but the global framerate for my whole application. i think i've seen something like this before but i can't find it anymore. thanks ...

How do I reverse a UTF-8 string in place?

Recently, someone asked about an algorithm for reversing a string in place in C. Most of the proposed solutions had troubles when dealing with non single-byte strings. So, I was wondering what could be a good algorithm for dealing specifically with utf-8 strings. I came up with some code, which I'm posting as an answer, but I'd be glad ...

How does Google Desktop Search manage to stay light and fast?

I always wondered what different methods Google Desktop Search is using so that it uses least CPU and memory while indexing a computer containing more 100,000 files on an average. In just few hours it has indexed the whole system and I did not see it eating up my CPU, memory etc. If any of you have done some research, please do share. ...

Is there a DBGrid component that can handle large datasets fast?

Large datasets, millions of records, need special programming to maintain speed in DBGrids. I want to know if there are any ready-made components for Delphi (DBGrids) that do this automatically? EDIT For Example: Some databases have features such as fetch 1st X records (eg 100 records). When I reach the bottom with scrolling, I want t...

C#-SQL: How to execute a batch of StoredProcedure?

Edit: My problem is not a problem anymore: I have redo my performances tests and I have do a fatal stupid error: I had forget a x1000 to get seconds from milliseconds :/ Sorry for that guys. For info: - I do some 1900 updates per second from my PC to the DataBase server on local network. - 3.200 updates per second if the programs ...

Is log4net much slower than System.Diagnostics.Trace?

I'm investigating the differences between using log4net and System.Diagnostics.Trace for logging, and I'm curious about the performance differences I've observed. I created a test application to compare the performance of both logging methods in several scenarios, and I'm finding that log4net is significantly slower than the Trace class...

Linq to SQL: select optimization

On large tables in MSSQL; selecting specific columns results in greater speed of the query. Does the same apply to Linq to SQL? Would this: var person = from p in [DataContextObject].Persons where p.PersonsID == 1 select new { p.PersonsID, p.PersonsAdress, p.PersonsZipcode }; be faster than this: var person...

Performance of using static methods vs instantiating the class containing the methods

I'm working on a project in C#. The previous programmer didn't know object oriented programming, so most of the code is in huge files (we're talking around 4-5000 lines) spread over tens and sometimes hundreds of methods, but only one class. Refactoring such a project is a huge undertaking, and so I've semi-learned to live with it for no...

CSS Performance

Usually when I build a site, I put all the CSS into one file, and all the properties that relate to a set of elements are defined at once. Like this: #myElement { color: #fff; background-color: #000; padding: 10px; border: 1px solid #ccc; font-size: 14pt; } .myClass { font-size: 12pt; padding: 5px; color...

How do I increase information in ASP.NET Trace

I've made some performance improvements to my application's backend, and to show the benefit to the end users of the GUI, we've been using the Trace.axd page to take timings. (The frontend is .Net 1.1 and the backend is Java, connected via Web services.) However, these timings show no difference between the old and the new backends. By...