Object Creation Under Windows NT4 and Windows 2000

Object Creation Under Windows NT4 and Windows 2000

Before I continue, I’d like to state up front thatnothing in this article should be construed as casting Windows 2000 / COM+ in anegative light. On the contrary, I’ve seen pretty much across the boardperformance increases for reasonably constructed transactions.The particular application I’m about to present has pretty drasticallydeviated from the recommended guidelines for server application construction.Nonetheless, if you are working with such a design, you should be aware of theramifications. Although you may be meeting your target performance rate underNT4, you might very well experience a dramatic performance drop in the future,if the application is deployed under Win2K.

Transaction a unit of work. Not to be confused withMTS/COM+ database transactions. To be sure, an MTS/COM+ database transaction is a transaction. But not every transaction is an MTS/COM+ database transaction.

A client of mine asked me to take a look at a problemhe was experiencing when deploying his application to Windows 2000. The truthwas, the application was not all that responsive under Windows NT4 either. Aftertweaking and optimizing, drastically reducing VB string concatenation, andadjusting the code for efficient objectaccess we were able to meet our stated goal of handling a server load of 5 usertransactions per second,with pages returning in under 5 seconds. We all realized that this rate ofperformance was pretty poor and we resolved to dramatically re-architect for thenext release. No one was prepared though for the performance drop we experiencedwhen the application was deployed under Win2K. Suddenly pages were taking 45 90 seconds to return! Obviously some pretty drastic blocking was taking place.My client asked me to figure out what was happening.

The term object is often used somewhat ambiguously. For the purposes of this article, an object refers to a particular instance of a class at run-time.

It is often very difficult to calculate expected server load prior to actual system deployment. A handy spreadsheet which can help calculate server load based on user population, and projected activity patterns, can be downloaded from ftp://FPSNow.com/FPSNow/LoadCalc_xls.zip.

Looking through the reports from the Web ApplicationStress Tool, it was easy to spot the problem areas. All were pages which invokeda common component structure to fetch the data and render the page. My firstline of investigation was to trace exactly what classes were involved in thistransaction. Easy enough. Throw a switch and convert the Library package into aServer package. Request the page and watch which objects spin up. I observed 39 objects spinning away. 39 Objects! A pretty class heavyhierarchy, if you ask me. But the worst was yet to come.

After consulting with the developers, it turned outthat several of these classes were collections of other classes. Since thecollection was data driven no one could be sure just how many classes wereactually being instantiated at run time. I inserted some profiling code to logevery class instantiation to a file. We were all amazed at the results. Theobject hierarchy, which we had already determined was comprised of 39 separateclasses, actually created 378 instances of those various classes!

Well, here was something pretty radical to take a closer look at. AlthoughMicrosoft has done a good job of ensuring behavioral compatibility between theMTS and COM+ runtimes, the literature is pretty clear that COM+ is verydifferent internally, from MTS. I wrote a small driver utility to benchmarkclass instantiation under MTS and under COM+. The results are quiteenlightening.

You can download the benchmark utility fromftp://FPSNow.com/FPSNow/CCBench.zip. The zip file contains all the source files forthe server components, a Windows client driver, as well as an ASP script driver.

The benchmark utility is quite flexible and provides numerous options forclass instantiation. The server component can either be called by the Windowsclient driver, or by the included ASP script. As Don Box states early on in his House of COM article in the March 2000 issue of MSDN, ‘Betweenthe addition of a new apartment type and the integration of the Microsoft®Transaction Services (MTS) context model into core COM, the number of possibleconfiguration scenarios is mind-boggling’. Since you can download thesource code and run your own benchmarks, we’ll avoid presenting and comparinga mind-boggling number of cases here. We’ll stick to the basics.

For our first suite of benchmarks we’ll use the Windows driver just totest raw class creation and collection access. Of course, these numbers won’tdirectly map into a multi-user scenario where concurrency will be an issue.We’ll get into concurrency later on when we’ll use the Web ApplicationStress Tool to drive our ASP benchmark script.

First a few points about class creation and access. Both of the cases abovecreated a collection of 1000 objects. The second case on the right performed aCross-Tier creation request, meaning the Windows driver called in to the middletier for each and every class creation and object access. For this benchmark,both the driver and the middle tier classes were installed on the same server.Obviously, this degradation would be even more exaggerated if the Windows driverwas deployed remotely, across a hardware boundary from the middle tier, as isusually the case. You can see how this cross tier construct has a radicalnegative impact on performance for a tiered architecture.

You’ll see this performance degradation where the middle tier components aredeployed remotely from its clients, or where it is installed to MTS/COM+ on thesame machine as its clients. Where the DLL is installed locally with the driver,and is simply registered, but not configured in either MTS or COM+, you won’t notice any difference (I tested up to 10,000 objects). Of course, if the Windows driver would be accessing the components remotely, via DCOM, then you’d certainly see a performance difference due to network latency for each communication between the client and the server.

Therefore, in a tiered scenario, wherever possible, allowserver  processing to take placeindependently of its client. In other words, let the client pass in enoughinformation immediately, so that the server can perform the requested task andreturn the results to the client in a single transaction.

We won’t discuss cross tier performance any more in this article since inour context, and generally speaking in an n-tier scenario, the cross tierconstruct usually represents a deficient software architecture. All of thenumbers presented below are generated using the n-tier paradigm where the clientmakes a single call in to the server layer, all processing is performed by theserver, and the results are finally returned back to the client.

OK, here are the numbers for raw object creation and access. All tests weretested on the exact same hardware platform, a PentiumII 450Mhz, with 256 MegsRAM. For raw object creation I deployed both the Windows driver and the serverclasses on the same PC. Since all object creation and access takes place in theserver layer, during this operation the Windows driver is simply idling and notconsuming any significant resources. (Later when we get into concurrency tests,I’ll be driving the Web Application Stress Tool on a separate clientworkstation.) Here are the numbers to create and access a collection of 1,000objects:

Raw ObjectCreation Scenario

 

 

Access Loops

 

Scenario

Creation

For Each

Sequential

Keyed

Destruction

NT4, Non-Configured

200 ms

10 ms

20 ms

30 ms

10 ms

NT4, MTS Library

270 ms

10 ms

30 ms

20 ms

81 ms

W2K, Non-Configured

500 ms

0 ms

30 ms

10 ms

10 ms

W2K, Library Defaults

8953 ms

40 ms

70 ms

60 ms

150 ms

 

Wow! Do you see what I see?Under Windows 2000, using the Library defaults (that is, the defaults which arepre-set by creating a Library application and dragging in the CCBench DLL)object creation takes 33 times longer than it does under NT4 in a LibraryPackage! Now it is true that we were able to optimize the Win2K Library scenarioand see quite an improvement as shown below. We adjusted the followingdeclarative settings in an attempt to minimize object creation and accessoverhead. At the package level, set the security level to perform access checks only at the process level. At the component level, for all three components, disable transaction support, disable JIT, remove support for events and statistics, and disable synchronization support. Then for the Obj and ObjCol objects, specify that they must be activated in the caller’s context (colocation). The ObjWrapper component cannot be colocated since its caller is outside of the COM+ application. After applying these settings we saw the followingbenchmarks:

W2K, Library Optimized

691 ms

10 ms

20 ms

20 ms

10 ms

Object creation time hasimproved quite a bit. But still, even under this optimal scenario (which is onlypossible for non-JIT, non-transactional components), object creation under Win2K took 2

devx-admin

devx-admin

Share the Post:
Apple Tech

Apple’s Search Engine Disruptor Brewing?

As the fourth quarter of 2023 kicks off, the technology sphere is abuzz with assorted news and advancements. Global stocks exhibit mixed results, whereas cryptocurrency

Revolutionary Job Market

AI is Reshaping the Tech Job Market

The tech industry is facing significant layoffs in 2023, with over 224,503 workers in the U.S losing their jobs. However, experts maintain that job security

Foreign Relations

US-China Trade War: Who’s Winning?

The August 2023 visit of Gina Raimondo, the U.S. Secretary of Commerce, to China demonstrated the progress being made in dialogue between the two nations.

Pandemic Recovery

Conquering Pandemic Supply Chain Struggles

The worldwide coronavirus pandemic has underscored supply chain challenges that resulted in billions of dollars in losses for automakers in 2021. Consequently, several firms are

Game Changer

How ChatGPT is Changing the Game

The AI-powered tool ChatGPT has taken the computing world by storm, receiving high praise from experts like Brex design lead, Pietro Schirano. Developed by OpenAI,

Apple Tech

Apple’s Search Engine Disruptor Brewing?

As the fourth quarter of 2023 kicks off, the technology sphere is abuzz with assorted news and advancements. Global stocks exhibit mixed results, whereas cryptocurrency tokens have seen a substantial

GlobalFoundries Titan

GlobalFoundries: Semiconductor Industry Titan

GlobalFoundries, a company that might not be a household name but has managed to make enormous strides in its relatively short 14-year history. As the third-largest semiconductor foundry in the

Revolutionary Job Market

AI is Reshaping the Tech Job Market

The tech industry is facing significant layoffs in 2023, with over 224,503 workers in the U.S losing their jobs. However, experts maintain that job security in the sector remains strong.

Foreign Relations

US-China Trade War: Who’s Winning?

The August 2023 visit of Gina Raimondo, the U.S. Secretary of Commerce, to China demonstrated the progress being made in dialogue between the two nations. However, the United States’ stance

Pandemic Recovery

Conquering Pandemic Supply Chain Struggles

The worldwide coronavirus pandemic has underscored supply chain challenges that resulted in billions of dollars in losses for automakers in 2021. Consequently, several firms are now contemplating constructing domestic manufacturing

Game Changer

How ChatGPT is Changing the Game

The AI-powered tool ChatGPT has taken the computing world by storm, receiving high praise from experts like Brex design lead, Pietro Schirano. Developed by OpenAI, ChatGPT is known for its

Future of Cybersecurity

Cybersecurity Battles: Lapsus$ Era Unfolds

In 2023, the cybersecurity field faces significant challenges due to the continuous transformation of threats and the increasing abilities of hackers. A prime example of this is the group of

Apple's AI Future

Inside Apple’s AI Expansion Plans

Rather than following the widespread pattern of job cuts in the tech sector, Apple’s CEO Tim Cook disclosed plans to increase the company’s UK workforce. The main area of focus

AI Finance

AI Stocks to Watch

As investor interest in artificial intelligence (AI) grows, many companies are highlighting their AI product plans. However, discovering AI stocks that already generate revenue from generative AI, such as OpenAI,

Web App Security

Web Application Supply Chain Security

Today’s web applications depend on a wide array of third-party components and open-source tools to function effectively. This reliance on external resources poses significant security risks, as malicious actors can

Thrilling Battle

Thrilling Battle: Germany Versus Huawei

The German interior ministry has put forward suggestions that would oblige telecommunications operators to decrease their reliance on equipment manufactured by Chinese firms Huawei and ZTE. This development comes after

iPhone 15 Unveiling

The iPhone 15’s Secrets and Surprises

As we dive into the most frequently asked questions and intriguing features, let us reiterate that the iPhone 15 brings substantial advancements in technology and design compared to its predecessors.

Chip Overcoming

iPhone 15 Pro Max: Overcoming Chip Setbacks

Apple recently faced a significant challenge in the development of a key component for its latest iPhone series, the iPhone 15 Pro Max, which was unveiled just a week ago.

Performance Camera

iPhone 15: Performance, Camera, Battery

Apple’s highly anticipated iPhone 15 has finally hit the market, sending ripples of excitement across the tech industry. For those considering upgrading to this new model, three essential features come

Battery Breakthrough

Electric Vehicle Battery Breakthrough

The prices of lithium-ion batteries have seen a considerable reduction, with the cost per kilowatt-hour dipping under $100 for the first occasion in two years, as reported by energy analytics

Economy Act Soars

Virginia’s Clean Economy Act Soars Ahead

Virginia has made significant strides towards achieving its short-term carbon-free objectives as outlined in the Clean Economy Act of 2020. Currently, about 44,000 megawatts (MW) of wind, solar, and energy

Renewable Storage Innovation

Innovative Energy Storage Solutions

The Department of Energy recently revealed a significant investment of $325 million in advanced battery technologies to store excess renewable energy produced by solar and wind sources. This funding will

Renesas Tech Revolution

Revolutionizing India’s Tech Sector with Renesas

Tushar Sharma, a semiconductor engineer at Renesas Electronics, met with Indian Prime Minister Narendra Modi to discuss the company’s support for India’s “Make in India” initiative. This initiative focuses on

Development Project

Thrilling East Windsor Mixed-Use Development

Real estate developer James Cormier, in collaboration with a partnership, has purchased 137 acres of land in Connecticut for $1.15 million with the intention of constructing residential and commercial buildings.

USA Companies

Top Software Development Companies in USA

Navigating the tech landscape to find the right partner is crucial yet challenging. This article offers a comparative glimpse into the top software development companies in the USA. Through a

Software Development

Top Software Development Companies

Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in and explore the leaders in

India Web Development

Top Web Development Companies in India

In the digital race, the right web development partner is your winning edge. Dive into our curated list of top web development companies in India, and kickstart your journey to

USA Web Development

Top Web Development Companies in USA

Looking for the best web development companies in the USA? We’ve got you covered! Check out our top 10 picks to find the right partner for your online project. Your

Clean Energy Adoption

Inside Michigan’s Clean Energy Revolution

Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the state. A Senate committee meeting

Chips Act Revolution

European Chips Act: What is it?

In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor supply chain and enhance its