optimization

In a Web 2.0 site, how long (in sec) should a newly added tag take to show and be indexed for search?

I'm building a web 2.0 site with tagging functionality and wanted to get a sense from anyone with experience how long (in sec) the system can take to a) show a new tag on a given record and b) index the tag for search. For example, does a newly added tag have to be available for search in 1 second but show on the user's screen in .1 sec...

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...

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...

IIS 6 Tuning Guide?

I have been a developer for 10+ years and so far my IIS knowledge is just enough for deploying stuff on it and get it running. Recently I have been playing with IIS 6 and realize the huge difference on the worker process model. I think I would need some good guide to update my knowledge in this area. Any good article/book recommendation?...

Is there a good way to do a SQL "InsertOrUpdate"?

I have some data records that may or may not exist already in my database. Right now when I want to update these records, I have to keep track of whether I got them from the DB, or created them from scratch, so that I know whether to make an INSERT or UPDATE query. I could query the database just before writing to find out if the recor...

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's the best way to write [0..100] in C#?

I'm trying to think of clever, clear, and simple ways to write code that describes the sequence of integers in a given range. Here's an example: IEnumerable<int> EnumerateIntegerRange(int from, int to) { for (int i = from; i <= to; i++) { yield return i; } } ...

Where to place Javascript in a HTML file?

Say I have a fairly hefty javascript file*, packed down to roughly 100kb or so, where's the best place to put this in the HTML? <html> <head> <!-- here? --> <link rel="stylesheet" href="stylez.css" type="text/css" /> <!-- here? --> </head> <body> <!-- here? --> <p>All the page content ...</p> <!-- or here? --> </...

Optimizing single-row queries from large tables in MySQL

I am dealing with MySQL tables that are essentially results of raytracing simulations on a simulated office room with a single venetian blind. I usually need to retrieve the simulation's result for a unique combination of time and blind's settings. So I end up doing a lot of SELECT result FROM results WHERE timestamp='2005-05-05 12:30:2...

How can I tune the PHP realpath cache?

Recent versions of PHP have a cache of filenames for knowing the real path of files, and require_once() and include_once() can take advantage of it. There's a value you can set in your php.ini to set the size of the cache, but I have no idea how to tell what the size should be. The default value is 16k, but I see no way of telling how ...

What's faster in VB? Removing an element from an array or inserting one?

Which is faster? someCondition has the same probability of being true as it has of being false. Insertion: arrayList = Array("apple", "pear","grape") if someCondition then ' insert "banana" element end if Deletion: arrayList = Array("apple","banana","pear","grape") if not someCondition then ' remove "banana" element end if ...

How do you test running time of VBA code?

Is there code in VBA I can wrap a function with that will let me know the time it took to run, so that I can compare the different running times of functions? ...

Oracle SQL technique to avoid filling trans log

Newish to Oracle programming (from Sybase and MS SQL Server). What is the "Oracle way" to avoid filling the trans log with large updates? In my specific case, I'm doing an update of potentially a very large number of rows. Here's my approach: UPDATE my_table SET a_col = null WHERE my_table_id IN (SELECT my_table_id FROM my_table WHE...

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...

Examples of Optimization in VB/VBA/VB.net?

Please post examples of optimization done in VB/VBA/VB.net? Optimization can be in the context of performance or space/maintainability. Edit: Please specify somewhere in your post which environment you know your technique works in. Thanks. ...

How do I profile how long a piece of code takes to execute in Objective-C/Cocoa for optimization purposes

Lets say I've got two interchangeable pieces of code and I want to figure out which one of them takes less processor time to execute. How would I do this? To get a very rough estimation I could just put NSLog() calls on either side of the code I wanted to profile, but it seems like the processor being otherwise very busy could skew the ...

Tools for sparse least squares regression

Hi, I want to do sparse high dimensional (a few thousand features) least squares regression with a few hundred thousands of examples. I'm happy to use non fancy optimisation - stochastic gradient descent is fine. Does anyone know of any software already implemented for doing this, so I don't have to write to my own? Kind regards. ...

Minimize CSS length holding style of given HTML constant

Suppose A.css styles B.html. What tools/techniques are there to programmatically reduce the size of A.css while holding its styling effects on B.html constant? Here are some techniques I would imagine such a tool using: Remove redundancies in A.css. For example, if the same class is defined twice you can remove the second definition wi...

What are advantages of using google.load('jQuery', ...) vs direct inclusion of hosted script URL?

Google hosts some popular JavaScript libraries at: http://code.google.com/apis/ajaxlibs/ According to google: The most powerful way to load the libraries is by using google.load() ... What are the real advantages of using google.load("jquery", "1.2.6") vs. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/lib...