Maintaining a diversified portfolio is a good way for most investors to minimize risk, improve slumber, and ensure they don't miss out on winning sectors.

Diversification can mean many things -- small vs. large stocks, value vs. growth stocks, and so on -- but most often it's taken to mean spreading your bets among a variety of industries. Of course, just because you want to have some exposure to a variety of industries doesn't mean you want to have the same amount of exposure to all industries.

So what of the tech sector? Should we be digging in or pulling back right now? Let's take a look.

Performance
Here's a look at how performance has broken down among the S&P 500 industries:

Sector

Month-to-Date Performance

Quarter-to-Date Performance

Year-to-Date Performance

Industrials

4.4%

4.4%

17.4%

Consumer Discretionary

6.6%

6.6%

17.3%

Financials

4.3%

4.3%

15.6%

S&P 500 Overall

3.1%

3.1%

8.2%

Information Technology

4.4%

4.4%

6.2%

Energy

5.2%

5.2%

5.3%

Consumer Staples

0.3%

0.3%

5.3%

Materials

1.4%

1.4%

3.8%

Health Care

(2.3%)

(2.3%)

0.6%

Utilities

2.0%

2.0%

(2.7%)

Telecom Services

0.0%

0.0%

(5.6%)

Source: Standard & Poor's as of April 21.

The tech sector has lagged the full S&P index so far this year. This shouldn't be too surprising, as it was one of the strongest sectors last year. In 2009, the Vanguard Information Technology ETF -- which holds big positions in tech majors like Microsoft (Nasdaq: MSFT), Apple, and IBM -- easily outpaced the S&P.

But the sector has been heating back up this month thanks to strong earnings numbers from big players like Intel (Nasdaq: INTC), Google (Nasdaq: GOOG), and Apple.

Let's take a closer look
Here's a peek under the hood of some of the major U.S. tech stocks.

Company

Market Cap

Subsector

Return on Equity

Price-to-Earnings

Microsoft

$275 billion

Software and services

41.3%

17.1

Apple

$222 billion

Technology hardware

31.9%

24.1

Google

$177 billion

Software and services

20.7%

25.0

IBM

$166 billion

Technology hardware

74.4%

13.2

Cisco (Nasdaq: CSCO)

$156 billion

Technology hardware

15.5%

26.0

Source: Capital IQ, a Standard & Poor's company.

While splitting up the tech industry into software, hardware, and semiconductors may be useful for some purposes, I think they're clumsy classifications from an investing standpoint.

Instead, I'd suggest splitting up the field into business-driven, consumer-driven, and raw materials. IBM, Cisco, and database giant Oracle (Nasdaq: ORCL) are perfect examples of companies that are driven primarily by business spending and will thrive when the economy is humming and companies are willing to shell out money for technology and consulting services.

Apple is an obvious example of a company that's driven by consumers, but other cell-phone makers, like Nokia and Research In Motion, are also huge tech players. Outside of mobile phones, eBay and Activision Blizzard (Nasdaq: ATVI) are also consumer-driven tech companies.

And finally we have raw material companies. These are companies like Intel, Qualcomm, and Corning (NYSE: GLW) that provide key inputs for companies that sell end products to both businesses and consumers. They tend to be driven by combined business and consumer demand and are generally more cyclical than the rest of the tech sector.

Besides giving us a better framework to think about the industry, these segmentations also highlight why tech is such an economic barometer. When tech companies start moving in the right direction, it means that businesses and consumers are getting bullish about the economy.

Putting it all together
To say that an investor should be equal weight in the technology sector isn't a small thing. Currently, tech accounts for nearly 20% of the entire S&P 500 index.

The reason for this is twofold. First, tech has become a very significant part of the overall U.S. economy. In addition, the sector carries higher valuations than other S&P sectors.

The table above uses trailing earnings for the P/E measure, and those P/Es fall when we look at them on the basis of 2010 earnings. Cisco's earnings multiple, for instance, drops to 18 when we consider expected earnings for its current fiscal year.

But the fact remains that the sector (as measured by the Vanguard ETF) has outperformed the S&P by around 40% over the past five years, and many tech stocks are looking pretty expensive today. For that reason, investors trying to find good deals in tech have a big burden on their shoulders.

While growth-oriented investors may find themselves enamored with tech company growth rates, I think most investors, particularly those with a value bent, are probably better off being somewhat underweight tech right now.

What do you think? Are you bullish or bearish on the tech sector? Scroll down to the comments section and share your thoughts.

The tech sector may not be particularly cheap, but these three stocks are.