Main

September 21, 2007

Tools used for DotSVN - Resharper

I have been using a trial version of ReSharper for my DotSVN project and I should say that I just got hooked to it. I would not have made this much progress without it and that leaves me wondering what I would do once the trial expires!!

A tool with this ease of use is needed to improve the design and code without any hesitation to refactor.
ReSharper's code navigation capabilities are also extra ordinary. You can read more about it here.

I have also used dotTrace to fix a nasty performance issue.

Overall I am very satisfied with the product.

September 19, 2007

Performance of DateTime.Parse()

I would like to write a series of posts describing the various performance issues I faced while implementing DotSVN.

In this post I discuss the performance penalty of using DateTime.Parse().

During my testing, I found that DotSVN was running quite slow. I used a trial version of 'JetBrains dotTrace 3.0' to analyze the problem. The following is a screen-shot of the dotTrace session.
DateTime.Parse() Performance issue

As you can see, 26% of the time is spend on the method call 'System.DateTime.Parse()'. This was unacceptable. After some investigation I found that the performance of the DateTime Parse method can be improved if we give some clue on formatting of the date string. This can be achieved using the ParseExact() method.

note: I have updated the code to re-use the CultureInfo class.
AlexKucherenko - Thanks for the comment.



The performance gain is quite obvious with the following figure, which shows the dotTrace session after applying the above fix.
DateTime.ParseExact() solution

As you can see, DateTime.Parse() is no longer a hot Spot. This also shows the power of dotTrace, and how it helped to quickly narrow down the issue.

September 12, 2007

The SVNKit influence on DotSVN

I used two good references when doing DotSVN. The first is (obviously) the SVN code itself. It is written in C using Apache Portable Runtime (APR).

What I would like to highlight is the second reference that I used - which is SVNKit. SVNKit is:

... a pure Java Subversion client library. You would like to use SVNKit when you need to access or modify Subversion repository from your Java application, be it a standalone program, plugin or web application. Being a pure Java program, SVNKit doesn't need any additional configuration or native binaries to work on any OS that runs Java.

I used VStudio's 'Java Language Conversion Assistant 3.0' to create a C# version of the SVNKit code. Though it had thousands of migration errors, this exercise gave me a good idea of the effort involved in completing DotSVN. I used the skeleton code from the migration as the basis for most of the my classes.

DotSVN has a different namespace structure (as shown in the figure below):
DotSVN Namespace and project structure

DotSVN depends more heavily on .Net base class libraries (like Deflate stream, custom Date parsing etc). It also uses generics and collection classes more efficiently.

September 11, 2007

DotSVN progress

I am personally quite happy with the progress that I could make on DotSVN. Using this library, it is currently possible to do the following operations.
  • Open an FSFS SVN repository
  • Enumerate its contents
  • Retrieve the properties collection of each element
  • Get the contents as a stream
I have also added three sample application. One is a console based application. The second one is a WinForms GUI sample that is very similar to the TortoiseSVN repository browser. The third one, is a browser based SVN repository viewer using Yahoo UI controls.

September 9, 2007

"Block length does not match with its complement." in DeflateStream

I wanted to discuss a problem that I faced while implementing the repository layer of DotSVN.
When I tried to use the System.IO.Compression.DeflateStream to decompress the repository, I get the exception 'System.IO.InvalidDataException' : "Block length does not match with its complement."

I Googled around an found this article that explains the problem. The feedback from Microsoft on how to fix this issue is as follows:
...skipping past the first two bytes solved the problem. Those bytes are part of the zlib specification (RFC 1950), not the deflate specification (RFC 1951). Those bytes contain information about the compression method and flags.

The zlib and deflate formats are related; the compressed data part of zlib-formatted data may be stored in the deflate format. In particular, if the compression method in the zlib header is set to 8, then the compressed data is stored in the deflate format. This is true in the case of the stream you submitted, which was taken from a pdf file.

Our DeflateStream, on the other hand, represents the deflate specification (RFC 1951) but not RFC 1950. So your workaround of skipping past the first 2 bytes to get to the deflate data will definitely work.
So the actual code would look like the following:

August 27, 2007

Significant milestone reached for DotSVN

I am happy to announce the first increment release of DotSVN.

DotSVN is a 100% compatible (at the repository level) port of SVN - very similar to SVNKit. It can be used to access or modify SVN repository from DotNet application, be it a standalone program or from an Asp.Net web application. As mentioned here, this project was started to support the nTrac project.

 Sample GUI Client for DotSVN
Sample .Net application build using DotSVN, accessing an FSFS file repository using 'file access'.

May 13, 2007

DotNet IM Client based on XMPP

I have been working (along with my sister and cousin) on an XMPP based IM client. This is fully implemented in DotNet. The current version (1.0.1) can connect to Google Talk. The project is hosted here

You can get the latest code from the following SVN url:
http://chatapp.googlecode.com/svn/trunk/

Here are some screen shots of the application.

Main Window 

And the Chat Window

ChatWindow

The 'About Box' describes the different components that we are using.

AboutBox

 I would appreciate your valuable comments - please post them here.

May 2, 2007

SilverLight 1.1 Alpha

Microsoft announced the availability of SilverLight 1.1.

You can get started by visiting here.

Microsoft Silverlight is a cross-browser, cross-platform plugin for delivering the next generation of .NET based media experiences and rich interactive applications for the Web. Silverlight offers a flexible programming model that supports JavaScript, .NET, and other languages.

This is really interesting. A 4 MB download that contains a Cross-Platform CLR and which supports a good subset of the BCL - including support for .Net 3.5 stuff like LINQ.

September 30, 2006

With 'Dapper', you can treat the web like a database

What is Dapper? Well, according to the creators, dapper is...

... a service that allows you to extract and use information from any website on the Internet. For those familiar with web services, you can think of Dapper as an API maker. For the rest of you, Dapper allows you to build web applications and mashups using data from any website without any programming.

This means that you can treat the web like a database - well, almost. You can also call it a glorified screen-scrapper' with an Ajax frontend and a service to back it up.

A long time ago, I was inspired by an article with a similar theme. The title of the article was '.NET Web Data ToolKit'. You can find it here.

If you compare the two, with Dapper, we get the data published in standard, easily consumable formats like XML, RSS, JSON etc. With 'web data toolkit' (WDT), it is more programmatic and the results are returned as ADO.Net data sets. The author Tony Loton describes WDT as...

...a toolkit that allows you to SELECT nuggets of information FROM live web pages as though selecting from tables in a relational databas, using industry-standard SQL. Imagine if you could capture the results into an ADO.NET DataTable, allowing you to treat web data like any other data source.

Though this is a powerful idea, it has some drawbacks. To start with, we are dealing with some-one-else's data - it is after all screen scrapping! If you are OK with it and wants to take it to the next level - say, take any set of web site(s) and then mash them up to create totally new web services, then you stumble upon the next drawback. Which is the lack of a workflow.

In most non-trivial usecases the website exposes the data by taking the user through a sequence of steps. An example step could include a login, followed by a click on a link (say my account name) which than takes me to to my data (say my account details). So to get to the 'real' data, the user have to follow multiple steps and certain steps could be involve HTTP 'POST' and not get just simple "GET's. So the service should have support for executing a workflow of steps. On each step, we should be able to control the actual HTTP data being send to the server and also be able to specify alternate control path if things go wrong. So the support for a WorkFlow engine is critical.

The next problem with Dapper would be privacy. I cannot create a web service with Dapper to get to my personal data (say my bank details) as I would have to share my login credentials with the site. So what we really need is a toolkit that I can embed in my application - similar to Web Data ToolKit.

August 25, 2006

Consequence of the end of 'The Free Performance Lunch'!

In the article titled 'The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software', Herb Sutter explains the importance of improving our skills on writing concurrent programs - ie if we need to gain performance gains form all the multi-core CPUs that are coming out lately.

In this light, I have collected a series of articles that discuss this matter in detail.

Hope this helps.


technorati tags:, ,

March 1, 2005

Community Server 1.0

Community Server :: Forums (A .NET Open source discussion engine.), Community Server :: Blogs (A .NET Open source blogging engine) and Community Server :: Gallery (A .NET Open source photo gallery) all rolled up into one package called Community Server 1.0.
According to Rob Howard, they have started work on version 1.1 with the following theme.

Performance - we intend to run both www.asp.net/forums and blogs.msdn.com on Community Server. Today these sites serve millions of users on the same 2 web servers and single database server. We've introduced new architecture into Community Server and we expect performance and scale to be better overall, but we know we'll identify some new issues with these high traffic sites.
Simplification - We want to focus on simplifying the platform. We are going to introduce more wizard as well making the administration UI even more user friendly.
Quality - A big goal for Community Server was to release a product that was of very, very high quality. We are shipping with defects - actually about 50 that we know about - but most are minor and have acceptable workarounds. We fixed over 900 bugs (that we tracked). Our goal for 1.1 is to make the platform even better than 1.1

You can get it here.
Go Ahead and have fun!

January 8, 2005

On Designing Good Libraries

An interesting blog by Brad Abrams on designing good libraries.

August 16, 2004

First version of IL parser

I have finished writing a very simple demo application for my MSIL Parser porject. This demo takes an IL file as an argument and outputs the parsed data into the console.

I am using a compiled grammar file made by Goldparser. Currently there is a bug in the parser module of this application. When really big IL files are given for parsing, this module throws an
IndexOutOfRangeException exception.

July 9, 2004

Code Cross Referencing tools

I am looking for a good Code Cross Referencing tool for .Net.
Total .Net XRef is one such example. But I am looking for more features like Call graph etc.

If you know of any, please add the same as a comment... Thanks

July 7, 2004

Direct Download Links to VS8 Beta

These are the direct download links as provided by Microsoft:
I got this information from here. I am just reproducing it here so that you dont have to search.

MSDN : http://download.microsoft.com/download/d/5/f/d5fbf037-59b9-4906-b20b-de5dd544de12/msdnixp.exe

C++: http://download.microsoft.com/download/1/f/9/1f9c364a-7835-426f-a12e-238bdf8e3ebf/vcsetup.exe

C#: http://download.microsoft.com/download/8/c/7/8c784f26-8e95-43b9-90b9-56b511220dfb/vcssetup.exe

dotnetfx2.0: http://download.microsoft.com/download/9/6/6/9666067a-660f-48e0-a755-a83a81036b67/dotnetfx.exe

SQL Server 2005 Express : http://download.microsoft.com/download/c/f/8/cf872b5a-509b-44ce-b5ac-e693f7aec971/SQLEXPR.EXE

WebDev : http://download.microsoft.com/download/6/e/1/6e1e9b98-928c-45f0-b44b-39f205090446/vwdsetup.exe

VB: http://download.microsoft.com/download/3/f/5/3f52b37c-92a4-4ce0-9de0-0376165e5461/vbsetup.exe

J#: http://download.microsoft.com/download/b/3/4/b34f6e5a-5ae8-4aec-b3dd-d1d0e0af8fac/vjredist.exe


Please let me know if these links do not work.

July 5, 2004

Paint.NET: MS Paint replacement

I was browsing through and I found a good replacement for MSPaint called Paint.Net.
A free download is available. Have fun....

Paint.NET is a senior design project aided by a mentor at Microsoft. It is a paint program designed entirely by students and written using Microsoft's .NET Framework. The program makes it easier to create and edit photos. It maintains some of the best features of the original MS-Paint application and includes new, powerful tools. Such new tools include a history storage for undos and redos, and powerful multi-layering which is often seen only in high-quality, expensive photo-applications. This product was engineered with the latest in graphics and coding technology such as the new C# language from Microsoft, and the GDI+ graphics libraries. These programming frameworks allowed for the creation of a speedy, responsive application with an amazing array of graphic capabilities.

Archives

Subscribe by e-mail

Creative Commons License
This weblog is licensed under a Creative Commons License.