performance

Capture CPU and Memory usage dynamically

I am running a shell script to execute a c++ application, which measures the performance of an api. i can capture the latency (time taken to return a value for a given set of parameters) of the api, but i also wish to capture the cpu and memory usage alongside at intervals of say 5-10 seconds. is there a way to do this without effecting...

How do I handle/edit large amount of text in WPF?

What would be a good approach to display and edit large amount of unformatted text (just like notepade does) using WPF? Loading a big string into a TextBox makes the UI unresponsive. The overall performance is not nearly comparable with TextBox Controls of previous Microsoft UI Frameworks. What options do I have to solve this problem. ...

Threads vs Processes in Linux

I've recently heard a few people say that in Linux, it is almost always better to use processes instead of threads, since Linux is very efficient in handling processes, and because there are so many problems (such as locking) associated with threads. However, I am suspicious, because it seems like threads could give a pretty big perform...

x=x+1 vs. x +=1

I'm under the impression that these two commands result in the same end, namely incrementing X by 1 but that the latter is probably more efficient. If this is not correct, please explain the diff. If it is correct, why should the latter be more efficient? Shouldn't they both compile to the same IL? Thanks. ...

Extreme wait-time when taking a SQL Server database offline

I'm trying to perform some offline maintenance (dev database restore from live backup) on my dev database, but the 'Take Offline' command via SQL Server Management Studio is performing extremely slowly - on the order of 30 minutes plus now. I am just about at my wits end and I can't seem to find any references online as to what might be ...

Slow performance from MapServer

I'm using mapserver to create a map that will be displayed with the google map api. I'm encountering performances issues. My maps are all in shapefile format. I run tests to get time to render maps. When rendering a map with the shp2img tool, using command line shp2img -i gif -m C:\myfolder\mymapfile.map -o C:\myfolder\test.gif -all_...

SQL Server 2005 & Antivirus Software

Our Network people insist on having antivirus (eTrust) software on ALL servers, including all of our SQL Server 2005 machines. How can I best demonstrate that this is hurting performance? ...

Lucene Performance: Retrieve all document from Searcher

I have approximately 10 million objects indexed using NIOFSDirectory. When I retrieve documents with MatchAllDocsQuery, the performance is significantly worse than other types of Query's, such as BooleanQuery. I ran some tests, performance is approximately 100 times worse. Since I am only interested in the top n documents anyway, is...

How to Handling Incremental Load with large datasets ssis

I have 2 tables (~ 4 million rows) that I have to do insert/update actions on matching and unmatching records. I am pretty confused about the method I have to use for incremental load. Should I use Lookup component or new sql server merge statement? and will there be too much performance differences? ...

A good architecture for Tagging items

Duplicate: How do you recommend implementing tags or tagging What's a efficient, fast and elegant architecture for a tagging system (such as posts or photos). For example, you have a site like StackOverflow and each item has a couple of tags. What's the best way to keep track of these, and make them searchable. Scalability is impor...

Preventing gtk FileChooserDialog calling stat on all files in the directory?

Opening a gtk FileChooserDialog is painfully slow for nfs directories containing many files. strace shows a lot of time calling "stat". About 5 calls for each of the files in the directory. How can we switch off the calls to 'stat' and just show a list of filenames without the modification time? We're using operating Redhat enterprise 4...

What's the most efficient way to determine whether an untrimmed string is empty in C#?

I have a string that may have whitespace characters around it and I want to check to see whether it is essentially empty. There are quite a few ways to do this: 1 if (myString.Trim().Length == 0) 2 if (myString.Trim() == "") 3 if (myString.Trim().Equals("")) 4 if (myString.Trim() == String.Empty) 5 if (myString.Trim().Equals(Strin...

Problematic data patterns, performance-wise

Assertion: the performance of SQL databases degrades when the volume of data becomes very large (say, tens or hunderds of terabytes). This means certain patterns in database design which are reasonable for most small-to-medium sized databases break down when the database grows. For (a rather general) example, there is a trend that moves...

thread performance on Linux vs. Solaris

This Linux Magazine article http://www.linux-mag.com/id/792 explains the difference in the way threads are implemented in Linux as compared to commercial Unixs such as Solaris. In summary, Linux uses a 1-to-1 mapping of user threads to kernel threads, while Solaris uses a many to many mapping. The article implies that this might give Sol...

Source text contains simple HTML. How can I simply format the text in MS Word?

I've inherited a project that stores basic HTML formatting (i.e. - <b>, <i> tags) in a database and writes it out to a Word document. This is my first Word automation assignment, so be gentle! Currently, there is a complicated function that runs after the document is complete that searches and replaces these tags. However, as this is ...

String concatenation in C# with interned strings

I know this question has been done but I have a slightly different twist to it. Several have pointed out that this is premature optimization, which is entirely true if I were asking for practicality's sake and practicality's sake only. My problem is rooted in a practical problem but I'm still curious nonetheless. I'm creating a bunc...

Faster way to delete matching rows?

I'm a relative novice when it comes to databases. We are using MySQL and I'm currently trying to speed up a SQL statement that seems to take a while to run. I looked around on SO for a similar question but didn't find one. The goal is to remove all the rows in table A that have a matching id in table B. I'm currently doing the follow...

Changing values in place instead of creating new instances

Basically I have checked out xna and some of slimdx (Promit :)), which has lots of structs. Pretty much all methods that looked like this: public static Vector3 operator + ( Vector3 a, Vector3 b ) where doing stuff like: Vector3 c = new Vector3 ( ... ) I am wondering if it makes sense to just do: a.X += b.X ... return a Obvious...

jQuery: hoverIntent and graphical effects -> drastic browser performance

I am working on a webpage that has a main menu, and a submenu that will hold different content for every button in the main menu. To keep the submenu open while hovering over it, I am using a combination of hoverIntent, hover, and a state variable: $.hovering: $(function() { $.hovering = false; $("div.button").hoverIntent( fun...

To Do or Not to Do: Store Images in a Database

In the context of a web application, my old boss always said put a reference to an image in the database, not the image itself. I tend to agree that storing an url vs. the image itself in the DB is a good idea, but where I work now, we store a lot of images in the database. The only reason I can think of is perhaps it's more secure? You...