Saturday, August 28, 2010

Architecture of SharePoint-2007

This blog is just an abstract of my recent session on SharePoint Overview.

What is SharePoint?
SharePoint is a software platform developed by Microsoft for collaboration and web publishing combined under a single server. These capabilities include developing web sites, portals, intranets, content management systems, search engines, wikis, blogs, and other tools for business intelligence

Architecture of SharePoint-2007
My understanding is graphically represented in the left side pyramid.

Operating System
Windows Server 2003
, which uses the Microsoft .NET 2.0 FW, Windows Workflow Foundation. Internet Information Services 6.0 is used for hosting Web applications of ASP.NET 2.x master pages, content pages, Web parts

Database Services
Microsoft SQL Server (either SQL 2000 SP4 or SQL 2005) is used to store all content i.e. data, file and configuration information.

Windows SharePoint Services
Storage: Content databases, Management: Administration pages with deep configuration options, Deployment: Web farms, physical servers, and roles, Site Model: Web application, site collection, and sites

Microsoft Office SharePoint Services
: Templates, people, audience targeting, Search: Search center, cross-site search, Content Management: Authoring, publishing, records management, Business Process: Forms server, line of business (LOB) integration, Business Intelligence: Excel services, Key Performance Indicator (KPI) lists, Report Center

Shared Services
User profile
store, Search services, Usage reporting, Excel services, Notification service for generating alerts

Saturday, August 21, 2010

Cache in Regular Expressions

The chart illustrates the difference in performance between the code, which relies on repeatedly instantiating a Regex object with the same regular expression pattern to call an instance matching method, and the second, which calls a static matching method.

// BAD: Never reinstantiate the same object
Regex rgx = new Regex(pattern);
return rgx.IsMatch(input);

// GOOD: Take advantage of regex cache
return Regex.IsMatch(input, pattern);

The execution time of the first code is about 15 times the execution time of the second example. The difference in performance is due to the caching of regular expressions used in static method calls. Whereas the first example instantiates a regular expression object and converts the regular expression into opcodes in each of fourteen method calls (one for each element in the string array), the second example performs this conversion only once, on the first method call. Subsequently, it retrieves the interpreted regular expression.from the cache each time the expression is needed.

Only regular expressions used in static method calls are cached; regular expressions used in instance methods are not. The size of the cache is defined by the Regex.CacheSize property. By default, 15 regular expressions are cached, although this value can be modified if necessary. If the number of regular expressions exceeds the cache size, the regular expression engine discards the least recently used regular expression to cache the newest one.

Note that there is a breaking change in regular expression caching between versions 1.1 and subsequent versions of the .NET Framework. In version 1.1, both instance and static regular expressions are cached; in version 2.0 and all subsequent versions, only regular expressions used in static method calls are cached.