performance

Threadpool vs delegates for async methods

Duplicate: C#: Asynchronous delegates vs ThreadPool.QueueUserWorkItem when initiating many connections When should one use the thread pool or make use of delegates to turn a blocking method into one which isn't? Also, when should one just create a thread (I know this is expensive and one guideline is when you're task is long ru...

Performance problems with external data dependencies

I have an application that talks to several internal and external sources using SOAP, REST services or just using database stored procedures. Obviously, performance and stability is a major issue that I am dealing with. Even when the endpoints are performing at their best, for large sets of data, I easily see calls that take 10s of secon...

Performance: Compile in VS, Run in Mono on Windows and Linux

Hi, I have the following questions: Is it possible to compile a C# project using VS.NET, and run it on mono? Are there any performance benefits associated with approach 1 (vs compiling with the mono compiler)? What about running the output .exe/.dll on linux? And what are the associated performance characteristics? Thanks ...

Are static methods good for scalability ?

Does static methods and class are good for scalability ? I think so static class/method improves scalability of application and instance methods doesn't scales much. So is it good programming practice to write static method where ever it is possible ? ...

How long does my code take to run?

How can I find out how much time my C# code takes to run? ...

Is there any difference in speed in manipulating different types of variables?

Hello everyone, This is in reference to C++ and using the Visual Studio compilers. Is there any difference in speed when reading/writing (to RAM) and doing mathematical operations on different types of variables such as bool, short int, int, float, and doubles? From what I understand so far, mathematical operations with doubles takes...

Is there anyway to compress jpeg using any technology to decrease upload time?

I have an online tool through which another user upload photos. The user is having issues when using slower bandwidth. I found this http://en.wikipedia.org/wiki/Lossless%5Fdata%5Fcompression 1) Is there any tool or API that utilizes this algorithm? 2) Will it slow the upload process for being able to compress locally? ...

ASP.Net excessive use of User Controls

Hi, I'm investigating an asp.net web application that extensively uses User Controls on each page. Most pages contain around 10-20 user controls. The User controls seem to be the visual representation of the business objects (if that makes sense), although at a finer granularity such as each tab of a tab control having its contents in a...

SQL: "NOT IN" alternative for selecting rows based on values of *different* rows?

Hello, everyone: How do you make an SQL statement that returns results modified by a subquery, or a join - or something else, that deals with information you're trying to return? For example: CREATE TABLE bowlers ( bowling_id int4 not null primary key auto_increment, name text, team text ); Someone might incorrectly be on more tha...

performance of frequently calling CGRectMake?

I would like to use CGRectMake to feed a rect structure to an image (image drawInRect:rect). Problem is, the position and the size of this rect will dynamically changed. Is there a performance hit for calling CGRectMake every "game loop frame"? Thanks! ...

Uniqueidentifier PK: Is a SQL Server heap the right choice?

OK. I've read things here and there about SQL Server heaps, but nothing too definitive to really guide me. I am going to try to measure performance, but was hoping for some guidance on what I should be looking into. This is SQL Server 2008 Enterprise. Here are the tables: Jobs JobID (PK, GUID, externally generated) StartDate (datetime...

How to efficiently insert elements after another known (by key or pointer) element in a PHP array ?

Given an array: $a = array( 'abc', 123, 'k1'=>'v1', 'k2'=>'v2', 78, 'tt', 'k3'=>'v3' ); With its internal pointer on one of its elements, how do I insert an element after the current element? And how do I insert an element after a key-known element, say 'k1'? Performance Care~ ...

Would it ever be wise to have a SQL server per web server?

I'm wondering if, under the circumstances that You get lots more reads than writes Your SQL server of choice is cheap/free and offers a fast mirroring/replication service Your database isn't insanely large rather than having separate SQL servers it would be better to have an instance of SQL on each machine getting instant updates fr...

How can we reduce the unnecessary loading of objects?

In hibernate as well as simple ORM strategy,i am normally loading all the values for the objects.Is there any way to avoid this. Due to this my app running slowly.. ...

WPF: fast way to apply formatting to RichTextBox

I'm trying to display basic syntax highlighting in a WPF RichTextBox. It mostly works, but the rendering performance is awful. First I naively tried: /// <summary> /// Main event handler for syntax highlighting. /// </summary> private void XmlChanged(object sender, TextChangedEventArgs e) { VM.Dirty = true; if (VM.Pretty) ...

User Defined Functions in Excel and Speed Issues

I have an Excel model that uses almost all UDFs. There are say, 120 columns and over 400 rows. The calculations are done vertically and then horizontally --- that is first all the calculations for column 1 are done, then the final output of column 1 is the input of column 2, etc. In each column I call about six or seven UDFs which call o...

How can I postpone database updates in Rails?

I'm building something akin to Google Analytics and currently I'm doing real time database updates. Here's the workflow for my app: User makes a RESTful API request I find a record in a database, return it as JSON I record the request counter for the user in the database (i.e. if I user makes 2 API calls, I increment the request count...

how the opcode cache actually works?

hi.. im doing my final project and its about optimizing web performance (focus on caching). i plan to use eaccelearator as a tool in my final project. i need to know the background process of it, the flow diagram about how it works and how an opcode cache can boost performance of websites. it can be eaccelerator, or anykind of opcode cac...

iis7 increase number of threads/concurrent requests per working process

How can I increase the number of threads/concurrent requests per working process on IIS7? I don't want to increase the number of processes to create a web garden (for now). ...

Type Conversion in Persisted Computed Column

Hi everybody I'm working with 2 related tables in a Microsoft SQL Server 2008 environment which are connected via a GUID. In one table, the field has the type varchar(50), the other one is properly types as uniqueidentifier. This is obviously bad but I can't change this now because it's given by a legacy piece of software. The conversi...