[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
article

Language-Dependent performance of design patterns

Published: 01 May 2003 Publication History

Abstract

The Gang of Four design patterns represent a catalog of 23 reusable design solutions to classes of problems that arise in a variety of applications. This study examines the execution performance of the patterns, as implemented in C++, Java (native and JDK 1.0 through 1.4), Smalltalk, and Perl 5.0. Each pattern is implemented independent of an application and, hence, represents just the pure object structure. Because the patterns themselves demonstrate a variety of structures, the results represent a good benchmark for how well the object-oriented compilers actually handle object-oriented programming, in particular, object creation and object reference to methods/attributes. The results indicate that the C++ compiler provided the fastest code, Java was second, followed by Smalltalk, and then Perl. However, Java 1.2 and 1.4 held their own against the optimized version of C++ and even did slightly better than non-optimized C++. Optimized C++ code was the best in 11 of the 23 patterns, with Java 1.2 and 1.4 sharing the remaining honors for the other 12 patterns, that is, a "winning" Java compiler can be found for just over half of the design patterns. Smalltalk was an order of magnitude, and Perl two orders of magnitude, slower. Although there is a wide variety of performance among the design patterns, the overall averages are much in-line with the averages of four simple test programs. The results may provide guidelines for future application development.

References

[1]
E. Gamma, R. Helm, R. Johnson, and J. Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995.
[2]
F. Buschmann, R. Meunier, H. Rohnert, P. Sommerlad, and M. Stal, Pattern-Oriented Software Architecture: A System of Patterns. Wiley, 1996.
[3]
M. Grand, Patterns in Java, Vol. 1. Wiley, 1998.
[4]
S. Alpert, K. Brown, and B. Woolf, The Design Patterns Smalltalk Companion. Addison-Wesley, 1998.
[5]
C. Larman, Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process, 2nd ed. Prentice Hall, 2002.
[6]
J. Long, "Software reuse antipatterns," ACM Software Engineering Notes, vol. 26, pp. 68--76, July 2001.

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGSOFT Software Engineering Notes
ACM SIGSOFT Software Engineering Notes  Volume 28, Issue 3
May 2003
70 pages
ISSN:0163-5948
DOI:10.1145/773126
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 May 2003
Published in SIGSOFT Volume 28, Issue 3

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 646
    Total Downloads
  • Downloads (Last 12 months)2
  • Downloads (Last 6 weeks)1
Reflects downloads up to 09 Jan 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media