performance

When to build your own buffer system for I/O (C++)?

I have to deal with very large text files (2 GBs), it is mandatory to read/write them line by line. To write 23 millions of lines using ofstream is really slow so, at the beginning, I tried to speed up the process writing large chunks of lines in a memory buffer (for example 256 MB or 512 MB) and then write the buffer into the file. This...

Why seal a class?

I'd like to hear what is the motivation behind the bulk of sealed classes in the .Net framework. What is the benefit of sealing a class? I cannot fathom how not allowing inheritance can be useful and most likely not the only one fighting these classes. So, why is the framework designed this way and wouldn't it be unbreaking change to u...

Do comments affect Perl performance?

I'm optimizing some frequently run Perl code (once per day per file). Do comments slow Perl scripts down? My experiments lean towards no: use Benchmark; timethese(20000000, { 'comments' => '$b=1; # comment ... (100 times) ', 'nocomments' => '$b=1;'}); Gives pretty much identical values (apart from noise). Benchmark: timing 1...

Better performance on updating objects with linq

I have two lists of custom objects and want to update a field for all objects in one list if there is an object in the other list which matches on another pair of fields. This code explains the problem better and produces the results I want. However for larger lists 20k, and a 20k list with matching objects, this takes a considerable ti...

How can I improve/replace sprintf, which I've measured to be a performance hotspot?

Through profiling I've discovered that the sprintf here takes a long time. Is there a better performing alternative that still handles the leading zeros in the y/m/d h/m/s fields? SYSTEMTIME sysTime; GetLocalTime( &sysTime ); char buf[80]; for (int i = 0; i < 100000; i++) { sprintf(buf, "%4d-%02d-%02d %02d:%02d:%02d", sysTime.wYear...

What are some resources for optimizing ActionScript (flash) for speed and size

I'm especially interested in memory profiling, reducing the size of a compiled .swf, measuring network latency, etc. Also, I'm focussed entirely on AS3. ...

Speed up sql JOIN

First of all, some background. We have an order processing system, where staff enter billing data about orders in an app that stores it in a sql server 2000 database. This database isn't the real billing system: it's just a holding location so that the records can be run into a mainframe system via a nightly batch process. This batch...

What hardware changes will affect WebLogic performance the most?

When requesting hardware for a WebLogic server, what hardware would best improve its performance? Should I give it lots of memory, CPU, fast hard drives? The OS is going to be Redhat 4 either Standard or Enterprise. ...

Performance implications of &p[0] vs. p.get() in boost::scoped_array

The topic generically says it all. Basically in a situation like this: boost::scoped_array<int> p(new int[10]); Is there any appreciable difference in performance between doing: &p[0] and p.get()? I ask because I prefer the first one, it has a more natural pointer like syntax. In fact, it makes it so you could replace p with a native...

Do Stored Procedures really boost performance in MS SQL / .NET?

Jeff Atwood wrote about this here, and while I understand the theoretical performance boost a stored procedure could offer, it does seem like a tremendous pain. What types of queries would you see the most performance increase using stored procedures, and what types of queries would you rather just build on the fly? Edit: Any documenta...

ASP.NET MVC - Script Combine

The ASP.NET team released the script combining feature in 3.5 SP1 as detailed here http://www.asp.net/Learn/3.5-SP1/video-296.aspx. Is there a similar feature already for the MVC framework? If not, is this in scope or is it possible to somehow leverage the webforms capability in MVC? I see this site uses a custom jquery.package.master wh...

Does a DataTable consume more memory than a List<T>?

Is there a trade off in respect to performance, trade off in respect to memory consumption? ...

MATLAB class array

What would be the best way to manage large number of instances of the same class in MATLAB? Using the naive way produces absymal results: classdef Request properties num=7; end methods function f=foo(this) f = this.num + 4; end end end >> a=[]; >> tic,for i=1:1000 a=[a Request];en...

Slow performance of AddString in MFC

I've got a dialog with several largeish combo boxes in it (maybe several hundred items apiece). There's a noticeable delay at construction while these are populated (confirmed that it's them by profiling). My initial thought was that sorting was killing it's performance, but disabling sort and using InsertString instead doesn't seem to ...

High Performance BPEL engine?

I am evaluating BPEL engine for our high performance telecom application but performance seem to be very poor. We have evaluated Apache Ode, SunBPEL engine, Active BPEL etc. Do you know any faster BPEL engine implementation or BPEL implementation in C/C++ ? ...

XPath vs DeSerialization: which one is better in performance for read operations

I'm passing small (2-10 KB)XML documents as input to a WCF service. now I've two option to read data values from incoming XML Deserialize to a strongly typed object and use object properties to access values use XPath to access values which approach is faster? some statistics to support your answer would be great. ...

Which tools or methods would you suggest for creating large amounts of SQL test data?

I'd like to stress test some of my SQL queries and find out about bad query plans and bottlenecks. I plan to fill some tables with random test data. Are there tools or a set of scripts available for this purpose, preferably for SQL Server? Thanks! UPDATE: Sorry, didn't know these two question already existed: Data generators for SQL...

Amazon EC2 Sql Performance

Hi, I'm considering using Amazon's EC2 with a windows instance & SQL. I've seen some criticism of the perf of the SQL instances here. I'm wondering if any SOers have and first hand experience and can comment on the performance. ...

Is there a better way to compare general performance of .Net and Java in an eCommerce setting than the "pet store"?

Hi, I've been using the Java Pet Store and .Net Pet Store examples for years when comparing JEE and .Net performance in an eBusiness type setting. Is there a better way to compare the performance of JEE and .Net for this type of application? Update: As some have pointed out below, the implementation, framework versions, architecture...

What are the actual performance differences between Int64 and Int32 on 32 and 64 bit MS Windows?

What are the actual performance differences between Int64 and Int32 on 32 and 64 bit MS Windows? It would also be great to see some actual timings of Int64 vs Int32 on each of the two operating system variants. XP or Vista would also be interesting. See also this question about memcpy performance. ...