Sunday, 8 January 2012

Fast Generic Pretty Printing

The F#.NET Journal just published an article about performance:

"The ability to convert values into legible strings efficiently, a process known as generic pretty printing, has a variety of uses including debugging and serialization. This article takes a look at the characteristics of the built-in pretty printer before considering alternatives including combinators and reflectors with a view to improving performance. Ultimately, a generic solution is proposed that runs 7,600× faster than the built-in F# solution on our test case..."


To read this article and more, subscribe to The F#.NET Journal today!

2 comments:

Art said...

I take it Resize.Array slows things down?

Flying Frog Consultancy Ltd. said...

@Art: Yes, ResizeArray (an alias for the .NET List collection) is surprisingly inefficient as an extensible array. Filling a raw array is much faster.