Wednesday, December 2, 2009

T4CSS: A T4 Template for .Less CSS With Compression

T4CSS: A T4 Template for .Less CSS With Compression


T4CSS: A T4 Template for .Less CSS With Compression

Posted: 02 Dec 2009 01:07 PM PST

Pain is often a great motivator for invention, unless you become dull to the pain. I think CSS is one of those cases where there's a lot of pain that we as web developers often take in stride. Fortunately not everyone accepts that pain and efforts such as LESS are born. As the home page states: LESS extends CSS with: variables, mixins, operations and nested rules. Best of all, LESS uses existing CSS syntax. This means you can rename your current .css files .less and they'll just work. LESS solves a lot of the pain of duplication when writing CSS. Originally written as a Ruby gem, Chris Jowen ported a version to .NET not surprisingly called .less . Here are some examples from the .less homepage: .Less implements LESS as an HttpHandler you add...(read more)

Silverlight 4 – Credentials, we’ve got it!

Posted: 02 Dec 2009 11:21 AM PST

I've been writing on Credentials in context of Silverlight for some time now. I didn't like the options that were available to secure services and allow integration with Silverlight. For some history search for "credentials" on my blog. July 2008 – Silverlight...( read more )...(read more)

Hacking the ASP.NET Parser

Posted: 01 Dec 2009 01:09 AM PST

A while ago I blogged about using external templates in an asp.net application. The problem with that was it wasn't natively supported, so I had to create a derived SpecialRepeater in order to take advantage of the external template system. In this latest parser hack I've managed to "trick" the asp.net parser into letting me declaratively set any template property to be a virtual path in order to load a user control into that template at runtime. How it works The ASP.NET compliation system is pretty complex. There are all kinds of extensibility points, including BuildProviders, PageParserFilters, ControlBuilders, ExpressionBuilders and the list goes on. One unknown *feature* of the parser is it's ability to generate code from something called...(read more)

Create a Silverlight Europe weather map

Posted: 02 Dec 2009 04:16 AM PST

.csharpcode-wrapper, .csharpcode-wrapper pre { background-color: #f4f4f4; border: solid 1px silver; cursor: text; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px 0px; max-height: 200px; overflow...( read more )...(read more)

Opening up Silverlight 4 Navigation: Introduction to INavigationContentLoader

Posted: 30 Nov 2009 12:37 AM PST

So, if you haven't noticed by now (or been following my previous blog posts), I happen to really enjoy exploring the Navigation feature in Silverlight.  A while back, I posted a number of workarounds and tips for some desirable scenarios using the...( read more )...(read more)

PDC09: ASP.NET MVC 2: Ninjas Still on Fire Black Belt Tips

Posted: 02 Dec 2009 01:04 AM PST

While I was at PDC last week in Los Angeles I got to present an ASP.NET MVC 2 presentation. Phil has been home playing with his new baby so I was thrilled to be able to give a presentation on his behalf. I gave the talk immediately after the Day 2 keynote a few minutes after they announced that they were giving all attendees custom laptops. This talk was a (virtually) no slides, just demos talk. I showed some new ASP.NET MVC 2 features, some tips and techniques that aren't/weren't ASP.NET MVC 2 specific. I also mentioned some community projects that are doing some cool things in the ASP.NET MVC space like MVCContrib and MVCTurbine . You can watch the HD version of the talk using Silverlight Smooth Streaming 1280x720 here or the non-HD...(read more)

Zag Studio’s web site

Posted: 01 Dec 2009 11:31 PM PST

Zag Studio's web site is now online! I plan to keep expanding the site with information that my clients and prospective clients find useful, so if there's anything you would like to see there, let me know. The Silverlight banner in the main...( read more )...(read more)

Hanselminutes Podcast 188: ASP.NET MVC 2 Beta with Phil Haack

Posted: 02 Dec 2009 12:13 AM PST

My one-hundred-and-eighty-eighth podcast is up . This last week I was at PDC but just before he left I chatted with Phil Haack about his exciting release of ASP.NET MVC 2 Beta. They chat about the changes, and Scott gets a surprise phone call from The Gu . Subscribe: Download: MP3 Full Show Do also remember the complete archives are always up and they have PDF Transcripts , a little known feature that show up a few weeks after each show. Telerik is our sponsor for this show. Check out their UI Suite of controls for ASP.NET . It's very hardcore stuff. One of the things I appreciate about Telerik is their commitment to completeness. For example, they have a page about their Right-to-Left support while some vendors have zero support, or don't...(read more)

Hanselminutes Podcast 186: .NET Debugging 101 with Tess Ferrandez

Posted: 02 Dec 2009 12:06 AM PST

My one-hundred-and-eighty-sixth podcast is up . I was in Sweden a few weeks and sat down with master debugger and ASP.NET Escalation Engineer Tess Ferrandez . She explains .NET Debugging 101. What's a dump file? Do you need PDBs? How do you use WinDBG and what are the best ways to debug memory issues, perf problems and hangs. Also check out video of Tess up on Channel 9 as she walks me through new debugging features in VS2010 . Subscribe: Download: MP3 Full Show Do also remember the complete archives are always up and they have PDF Transcripts , a little known feature that show up a few weeks after each show. Telerik is our sponsor for this show. Check out their UI Suite of controls for ASP.NET . It's very hardcore stuff. One of the...(read more)

Rocky Mountain Tech Trifecta v2.0 Registration Open

Posted: 01 Dec 2009 06:12 PM PST

Registration has now opened for this years Rocky Mountain Tech Trifecta.  This years all day event will be Feb 27th in Denver, Colorado at  Metro State College Denver.  If your not in Colorado – Don't stop reading yet – last year we had...( read more )...(read more)

64-Bit Programming with Visual C++ (Visual C++ 2008)

Posted: 01 Dec 2009 05:20 PM PST

This section discusses how to target 64-bit hardware with the Visual C++ build tools. Topics describe how to configure projects to target 64-bit platforms, and how to enable a 64-bit toolset at the command line. Other topics discuss common 64-bit migration issues, and Itanium and x64 software conventions.

Silverlight Team Twitter List

Posted: 01 Dec 2009 05:06 PM PST

Last week I wrote about the new Silverlight MVP Twitter list I created to make it easier to follow all of the Silverlight MVPs and the evangelists. You can follow the entire group using this link: www.twitter.com/john_papa/SilverlightMVP   I also...( read more )...(read more)

Pete Brown on Silverlight and WPF Convergence

Posted: 01 Dec 2009 03:37 PM PST

Great post from Pete over here about Silverlight/WPF convergence; "The Future of Client App Dev: WPF and Silverlight Convergence" It's funny as someone asked me just yesterday what my view was about Silverlight/WPF post-PDC and in the light of Silverlight...( read more )...(read more)

First experiments using MEF, MVVM and Silverlight 4 Beta

Posted: 01 Dec 2009 01:12 PM PST

MEF (Managed Extensibility Framework) is a new library available in Silverlight 4 Beta which permits to build applications that can be incrementally extended in a declarative way using three simple concepts (read this post by Glenn Block for more infos...( read more )...(read more)

/GL and PGO

Posted: 01 Dec 2009 11:02 AM PST

Hi, I'm Lin Xu, a Program Manager working on the C++ compiler.

Recently, we collated performance numbers from our testing passes over this release cycle. We track many different benchmarks closely for all of the architectures and switch options (/O1, /O2, /GL, /PGO). We also track these across multiple CPU models. (Yes, this is quite a big matrix. Look for an upcoming blog post from the QA team to learn more.)

We're pretty excited about the improvements we made for this release in code quality. (Read Ten's recent post about it here) As I looked at the numbers, one thing jumped out at me: To really take advantage of these improvements, applications need to be compiled with /GL, and PGO, if possible.

If you aren't familiar with PGO, you can read Lawrence's blog post on Profile Guided Optimization here.

I've summarized some of our data comparing VS2010 Beta2 with VS2008 SP1.0. Here is a comparison between integer benchmark performance with various switches on x86 and x64:

These particular graphs are based on a benchmark suite similar to SPEC CPU 2006. But our benchmarks include real world code as well. We build and measure performance of many Microsoft products, including SQL, Windows and Office.

 Let's say you currently build release builds with the /O2 switch in VS2008. If you moved to VS2010, you might see on x64:

·         10% faster code if you turned on /GL,

·         16% faster code if you turned on /GL and PGO

and on x86,

·         7% faster code if you turned on /GL,

·         13% faster code if you turned on /GL and PGO.

Now, for the last couple of releases, a new VC++ project will have /GL on for release builds. However, settings for upgraded projects are not changed. So whether you use the Visual Studio build system or your own custom build system, go ahead and check that you are specifying /GL for your release builds!

 The other recommendation I have is to use PGO. Doing so requires a larger investment (it requires you to figure out scenarios and create training data) – but it can improve the performance of your app above and beyond /GL. PGO works best on medium or larger applications. Small applications may see little benefit from PGO, depending on the application's workload.

We recently created training data and turned on PGO for part of the C++ intellisense engine in Visual Studio 2010 and saw ~25% better performance on some scenarios. When we turned on PGO for the compiler, we measured ~10% speedup in compiler throughput. Again, you can learn about how to turn on PGO in your own builds in Lawrence's blog post here.

/GL shouldn't increase your build time significantly, but note that /GL is not compatible with Edit and Continue (/ZI) and incremental builds (the linker option /INCREMENTAL). You can read some quick tips about /GL in another previous blog post here.

As Lawrence describes in his blog post, with PGO your application is built twice – once for the instrumented build and once for the final optimized build. This means build times increase more significantly, as but as I've noted above, the performance increase is also more significant.

So, if your application is CPU bound, I hope that these numbers will convince you to take a second look at your release build settings and turn on /GL and PGO!

 

No comments:

Post a Comment