InfoQ

News

Mainsoft: Running .NET on the JVM While Maintaining Performance

Posted by Ryan Slobojan on Jul 19, 2007 03:00 PM

Community
.NET,
Java
Topics
Java plus .NET Integration,
Stories & Case Studies
Tags
migration,
Java EE,
Mainsoft

Mainsoft recently released version 2.0 of Mainsoft for Java EE (formerly known as Visual Mainwin), and also released an intriguing whitepaper which showed that a .NET-based application which was cross-compiled to run on Java EE using Mainsoft for Java EE actually performed better in several areas than the original .NET-based application did. InfoQ spoke with Mainsoft CEO Yaacov Cohen to learn more.

First, Cohen was asked to describe how Mainsoft for Java EE worked:

The cross-compilation engine cross compiles the Microsoft Intermediate Language (MSIL) code generated by the .NET Framework compilers into Java Byte code. Our Java-based implementation of the .NET Framework runtime supports classes on which the application will execute. Finally, our Visual Studio extension enables developers to code, compile, deploy and debug Web and server applications on the Java Enterprise Edition platform.
Since the code is cross-compiled at the bytecode level, there is no source conversion - this means that Visual Studio.Net remains the sole development environment for the ported application. InfoQ also learned that Mainsoft has reimplemented a large portion of the .Net Framework in Java, including ASP.Net, ADO.Net, and the Web Services API - however, because Mainsoft for Java EE has a focus on web and server applications, components such as Windows Forms have not been implemented.

InfoQ looked at a Mainsoft whitepaper which presented a case study of one company's use of Mainsoft for Java EE to port an existing .Net-based Windows application over to a Java EE-based Linux application, and discovered the following things:

  • The ported Java EE application worked on IBM WebSphere, BEA WebLogic and Apache Tomcat
  • The ported Java EE application was tested on Windows, Linux, and AIX
  • On identical hardware, the ported Java EE application (running on WebSphere):
    • Handled 8% more requests per second (RPS) than the original .Net application
    • Had better CPU scalability, with almost linear increases in RPS
    • Had at least 4% faster response time across all tested user loads
    • Handled at least 5% more RPS under heavy load

On why Java was faster than .NET, Cohen was careful to point out that the whitepaper intended to show that server applications could be ported without a performance penalty:

We deliver equivalent performance by tuning our open source .NET implementation to fit WebSphere's architectural strengths, similar to how Microsoft's .NET framework leverages the strengths of IIS and Windows. For the performance study, we configured the appropriate garbage collection algorithm, page size and heap size on each OS and hardware configuration tested. We also identified the need to optimize the IBM Java Virtual Machine on some scenarios that were exposed with our libraries. These changes are now widely available in the WebSphere Application Server 6.1 release.

With the number of companies that have recently open-sourced their products (such as Sun's JDK, Terracotta's DSO, and Adobe's Flex SDK), InfoQ asked Cohen if Mainsoft was going to follow suit. He replied:

Cross-platform .NET is an ambitious project, and next to Novell, Mainsoft is the largest contributor to the Mono open source project. We share all our .NET Framework assemblies with Mono, with the exception of the core library mscorlib.jar, which is Mainsoft's proprietary Java EE implementation of the .NET core class library.

Mainsoft also offers a freely available developer edition, called Grasshopper, which can be used for deployments on Tomcat and single CPU configurations.

2 comments

Reply

Terracotta for .Net by ARI ZILKA Posted Jul 20, 2007 12:37 AM
Re: Terracotta for .Net by Ilya Kharmatsky Posted Jul 20, 2007 9:16 AM
  1. Back to top

    Terracotta for .Net

    Jul 20, 2007 12:37 AM by ARI ZILKA

    Would be interesting to see if a .NET object can be shared across instances using Terracotta beneath.

  2. Back to top

    Re: Terracotta for .Net

    Jul 20, 2007 9:16 AM by Ilya Kharmatsky

    Since ".Net object" become in Mainsoft for J2EE a regular "java object" - it should not be a problem...

Exclusive Content

Rationalizing the Presentation Tier

Thin client paradigm characterized by web applications is a kludge that needs to be repudiated. Old compromises are no longer needed and it's time to move the presentation tier to where it belongs.

Agile Project Management: Lessons Learned at Google

In this presentation filmed during QCon 2007, Jeff Sutherland, the creator of Scrum, talks about his visit at Google to do an analysis of Google's first implementation of Scrum.

AtomServer – The Power of Publishing for Data Distribution

In this article, Bryon Jacob and Chris Berry introduce AtomServer, their implementation of a full-fledged Atom Store based on Apache Abdera, which is now available as open source.

An Introduction to Virtualization

It is easy to think that virtualization applies only to servers. In reality the recent resurgence of the concept is also being applied to networking, storage, and application infrastructure.

REST Anti-Patterns

In this article, Stefan Tilkov explains some of the most common anti-patterns found in applications that claim to follow a "RESTful" design and suggests ways to avoid them.

Choosing between Routing and Orchestration in an ESB

In this article, Adrien Louis and Marc Dutoo discuss the differences and relative merits of using orchestration vs. routing in a typical ESB setup, and discuss various implementation options.

Enterprise Batch Processing with Spring

Wayne Lund discusses batch processing, Spring Batch objectives and features, scenarios for usage, Spring Batch architecture, scaling, example code, failures and retrying, and the future roadmap.

User Story Estimation Techniques

Developer Jay Fields draws on his experiences as a ThoughtWorks consultant to describe effective user story estimation techniques.