Click here to Skip to main content

Code Lean and Mean

In days of yore it was a badge of honour to be able to fit a full file manager, spreadsheet application, appointment reminder and Tetris Easter Egg within a 32KB executable.

Kids these days are hard pressed to get "Hello, World" in under 4MB so we're going to wind back the clock.

The Challenge

Create an application that will calculate and display the changes between two text files as fast as possible using the least amount of memory possible. Provide timing data and maximum memory use data to prove you're the leanest and meanest.

There will be 3 categories:

  1. C/C++
  2. .NET (any language)
  3. Any other language

Once you have created your application and posted it as an article, post a link in the forum below so we can all view and comment on it.


  1. You can wrap your solution in a GUI if you wish, and there's no need to report memory usage or speed of the framework you use to support your code.
  2. The format of the files is unimportant. Treat them as plain text.
  3. Some runtimes such as .NET have a large working set already. You only need to report the maximum amount of memory your code uses above and beyond the base working set needed by the underlying runtime. If. while calling runtime methods, member is allocated then if possible this will have to be taken into account.

Test Data

All applications will use the same data. This file contains two large HTML files that have a small number of changes.

The competition ends Midnight August 31, 2009.

The prize


Fame, adulation and a Code Project T-shirt.

Conditions of Entry | Current winners list

GeneralDeltaScope updated PinmemberChristopher Erker2-Sep-09 11:54 
General[Contest Entry] PinstaffSean Ewington1-Sep-09 11:30 
GeneralRe: [Contest Entry] PinmemberChristopher Erker1-Sep-09 12:06 
General...and a C# version for me too PinmemberEric Haddan31-Aug-09 17:15 
General[Contest Entry] PinmentorNick Butler31-Aug-09 10:23 
General[Contest Entry] PinmentorNick Butler31-Aug-09 3:47 
GeneralAnother C++ entry PinmemberAlain Rist29-Aug-09 23:26 
GeneralAnother C++ entry updated PinmemberAlain Rist31-Aug-09 11:44 
GeneralMy C++ Entry PinmemberEric Haddan29-Aug-09 16:05 
GeneralMy entry (PIEBALDdiff) [modified] PinmemberPIEBALDconsult28-Aug-09 16:21 
GeneralRe: My entry (PIEBALDdiff) PinmvpLuc Pattyn28-Aug-09 16:44 
GeneralRe: My entry (PIEBALDdiff) PinmemberPIEBALDconsult29-Aug-09 6:29 
GeneralNew entry PinmvpLuc Pattyn27-Aug-09 6:27 
GeneralNew version of old entry PinmvpLuc Pattyn31-Aug-09 16:58 
GeneralRe: New entry PinmemberMichael Scott Smith1-Sep-09 4:55 
GeneralRe: New entry PinmvpLuc Pattyn1-Sep-09 5:06 
GeneralRe: New entry PinmemberMichael Scott Smith1-Sep-09 12:59 
GeneralRe: New entry PinmemberMichael Scott Smith1-Sep-09 13:08 
General[Contest Entry] PinmentorNick Butler27-Aug-09 4:48 
NewsRe: [Contest Entry] Updated PinmentorNick Butler28-Aug-09 8:37 
GeneralSubmitted article for this contest. PinmemberGaurav Dudeja India27-Aug-09 0:51 
AnswerThe O(ND) diff algorithm is on CodeProject since 2006 [modified] PinmemberMatthias Hertel24-Aug-09 11:35 
At An O(ND) Difference Algorithm for C#[^]
you can find an implementation of Eugene Myers famous algorithm that I implemented in C# back in 2005 and put it on codeproject in 2006.
It is proved to find a smallest set of changes.
There are some more samples and an updated version around the core implementation available at[^]
The original implementation had a huge memory consumtion and so I optimized a lot by re-using the already allocated memory structures.
The core algorithm also only works with numeric values and not with text strings so the core algorithm is quiet efficient with memory.
modified on Monday, August 24, 2009 4:56 PM

General[Contest Entry] Code Lean and Mean File DIFF (FIFF) Application [modified] PinmemberIlka Guigova23-Aug-09 16:50 
GeneralNo problem. What's the coding job pay? PinmemberEdwin Smith21-Aug-09 14:00 
General[Contest entry] An LCS based diff-ing library in C# PinsitebuilderNishant Sivakumar20-Aug-09 20:29 
GeneralA line-by-line solution in C# Pinmemberpsouza4micronet20-Aug-09 11:28 
GeneralRe: A line-by-line solution in C# PinmemberPeter Souza26-Aug-09 7:49 
GeneralRe: A line-by-line solution in C# PinadminChris Maunder26-Aug-09 12:18 
GeneralRe: A line-by-line solution in C# PinmemberPeter Souza26-Aug-09 12:21 
GeneralMyEntry Pinmemberdarkoman20-Aug-09 7:10 
GeneralMy Entry for Lean & Mean PinmemberWasiq Amjad Bhamla15-Aug-09 11:53 
GeneralMuch more challenging PinmemberBillHudson14-Aug-09 9:36 
GeneralSome references PinmemberRosenne14-Aug-09 7:08 
GeneralMy Entry PinmemberMatthew Hazlett12-Aug-09 18:03 
GeneralRe: My Entry PinmemberMatthew Hazlett12-Aug-09 22:11 
GeneralRe: My Entry [modified] PinmemberMatthew Hazlett13-Aug-09 12:42 
GeneralRe: My Entry PinmemberMember 393164920-Aug-09 2:55 
GeneralRestrictions on multiple entries PinmemberDaniel Vaughan12-Aug-09 8:27 
GeneralRe: Restrictions on multiple entries PinadminChris Maunder12-Aug-09 9:33 
GeneralRe: Restrictions on multiple entries PinmvpLuc Pattyn27-Aug-09 12:22 
GeneralRe: Restrictions on multiple entries PinadminChris Maunder27-Aug-09 13:09 
GeneralRe: Restrictions on multiple entries; also bug report PinmvpLuc Pattyn27-Aug-09 13:20 
QuestionCondition of entry - has not been previously published PinmemberRosenne12-Aug-09 7:18 
AnswerRe: Condition of entry - has not been previously published PinadminChris Maunder12-Aug-09 7:56 
GeneralHow generic should the solution be ? PinmemberMoreno Airoldi12-Aug-09 4:22 
GeneralRe: How generic should the solution be ? PinadminChris Maunder12-Aug-09 4:33 
GeneralRe: How generic should the solution be ? PinmemberMoreno Airoldi12-Aug-09 7:57 
JokeNew competition PinmemberAdriaan Davel11-Aug-09 20:30 
GeneralAge limit, or not? PinmemberGMorris11-Aug-09 7:12 
GeneralRe: Age limit, or not? PinadminChris Maunder11-Aug-09 7:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 10 Aug 2009
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid