[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.5555/2486788.2486886acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Are your incoming aliases really necessary? counting the cost of object ownership

Published: 18 May 2013 Publication History

Abstract

Object ownership enforces encapsulation within object-oriented programs by forbidding incoming aliases into objects' representations. Many common data structures, such as collections with iterators, require incoming aliases, so there has been much work on relaxing ownership's encapsulation to permit multiple incoming aliases. This research asks the opposite question: Are your aliases really necessary?
In this paper, we count the cost of programming with strong object encapsulation. We refactored the JDK 5.0 collection classes so that they did not use incoming aliases, following either the owner-as-dominator or the owner-as-accessor encapsulation discipline. We measured the performance time overhead the refactored collections impose on a set of microbenchmarks and on the DaCapo, SPECjbb and SPECjvm benchmark suites. While the microbenchmarks show that individual operations and iterations can be significantly slower on encapsulated collection (especially for owner-as-dominator), we found less than 3% slowdown for owner-as-accessor across the large scale benchmarks.
As a result, we propose that well-known design patterns such as Iterator commonly used by software engineers around the world need to be adjusted to take ownership into account. As most design patterns are used as a building block in constructing larger pieces of software, a small adjustment to respect ownership will not have any impact on the productivity of programmers but will have a huge impact on the quality of the resulting code with respect to aliasing.

References

[1]
D. Clarke, J. Potter, and J. Noble, “Ownership types for flexible alias protection,” in OOPSLA. ACM Press, Oct. 1998, pp. 48–64.
[2]
J. Potter, J. Noble, and D. Clarke, “The ins and outs of objects,” in Australian Software Engineering Conference. Adelaide, Australia: IEEE Press, November 1998, pp. 80–89.
[3]
T. Zhao, J. Baker, J. Hunt, J. Noble, and J. Vitek, “Implicit ownership types for memory management,” Science of Computer Programming, vol. 71, no. 3, pp. 213–241, 2008.
[4]
D. Clarke, M. Richmond, and J. Noble, “Saving the World from Bad Beans: Deployment-Time Confinement Checking,” in OOPSLA. Anaheim, CA: ACM Press, 2003, pp. 374–387.
[5]
W. Dietl and P. Müller, “Universes: Lightweight ownership for JML,” Journal of Object Technology, vol. 4, no. 8, pp. 5–32, 2005.
[6]
S. Srinivasan and A. Mycroft, “Kilim: Isolation-typed actors for Java,” in ECOOP. Springer-Verlag, 2008, pp. 104–128.
[7]
B. Bloom, J. Field, N. Nystrom, J. stlund, G. Richards, R. Strnisa, J. Vitek, and T. Wrigstad, “Thorn: robust, concurrent, extensible scripting on the JVM,” in OOPSLA, 2009, pp. 117–136.
[8]
P. Haller and M. Odersky, “Capabilities for uniqueness and borrowing,” in ECOOP, 2010, pp. 354–378.
[9]
J. H. Spring, J. Privat, R. Guerraoui, and J. Vitek, “Streamflex: highthroughput stream programming in Java,” in OOPSLA. ACM Press, 2007, pp. 211–228.
[10]
R. L. Bocchino, Jr., V. S. Adve, D. Dig, S. V. Adve, S. Heumann, R. Komuravelli, J. Overbey, P. Simmons, H. Sung, and M. Vakilian, “A Type and Effect System for Deterministic Parallel Java,” in OOPSLA. ACM Press, 2009, pp. 97–116.
[11]
J. Dolby, C. Hammer, D. Marino, F. Tip, M. Vaziri, and J. Vitek, “A data-centric approach to synchronization,” ACM Trans. Program. Lang. Syst., vol. 34, no. 1, p. 4, 2012.
[12]
J. Noble, J. Vitek, and J. Potter, “Flexible Alias Protection,” in ECOOP, vol. 1445.
[13]
Springer-Verlag, Jul. 1998, pp. 158–185.
[14]
J. Aldrich and C. Chambers, “Ownership domains: Separating aliasing policy from mechanism,” in ECOOP, vol. 3086. Oslo, Norway: Springer-
[15]
Verlag, Jun. 2004, pp. 1–25.
[16]
P. Müller and A. Poetzsh-Heffter, “Universes: a Type System for Controlling Representation Exposure,” Fernuniversität Hagen, Tech. Rep. 263, 1999.
[17]
D. Gordon and J. Noble, “Dynamic ownership in a dynamic language,” in DLS Proceedings, 2007, pp. 9–16.
[18]
S. Markstrum, D. Marino, M. Esquivel, T. Millstein, C. Andreae, and J. Noble, “JavaCOP: Declarative pluggable types for Java,” TOPLAS, vol. 32, no. 2, pp. 4:1–4:37, 2010.
[19]
N. R. Cameron, J. Noble, and T. Wrigstad, “Tribal ownership,” in OOPSLA, 2010, pp. 618–633.
[20]
M. Naftalin and P. Wadler, Java Generics and Collections. O’Reilly Media, Inc., 2006.
[21]
J. Bloch, The Java Tutorials — Collections, Oracle Corporation, 2011, http://download.oracle.com/javase/tutorial/collections/.
[22]
A. Potanin, M. Damitio, and J. Noble, “Ownership and collections: The statistical analysis,” ECS, VUW, http://ecs.victoria.ac.nz/Main/ TechnicalReportSeries, Tech. Rep. ECSTR12-22, 2012.
[23]
J. Östlund and T. Wrigstad, “Multiple aggregate entry points for ownership types,” in ECOOP, LNCS, vol. 7313, 2012, pp. 156–180.
[24]
J. Noble, “Iterators and encapsulation,” in TOOLS Europe. IEEE Press, 2000, pp. 431–442.
[25]
D. Lea, “Jsr166 loops benchmarks,” http://gee.cs.oswego.edu/cgi-bin/ viewcvs.cgi/jsr166/src/test/loops/, 2012.
[26]
S. M. Blackburn, R. Garner, C. Hoffmann, A. M. Khang, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanovic, T. VanDrunen, D. von Dincklage, and B. Wiedermann, “The DaCapo benchmarks: Java benchmarking development and analysis,” in OOPSLA, Oct. 2006, pp. 169–190.
[27]
A. Georges, D. Buytaert, and L. Eeckhout, “Statistically rigorous Java performance evaluation,” in OOPSLA. Montreal, Quebec, Canada: ACM Press, Oct. 2007, pp. 57–76.
[28]
S. Nelson, D. J. Pearce, and J. Noble, “Profiling object initialization for java,” in Third International Conference on Runtime Verification, ser. RV 2012. Springer-Verlag, September 2012, pp. 292–307.
[29]
Y. Zibin, A. Potanin, P. Li, M. Ali, and M. D. Ernst, “Ownership and Immutability in Generic Java,” in OOPSLA. ACM, 2010, pp. 598–617.
[30]
J. Aldrich, V. Kostadinov, and C. Chambers, “Alias Annotations for Program Understanding,” in OOPSLA. ACM Press, 2002, pp. 311–330.
[31]
C. Grothoff, J. Palsberg, and J. Vitek, “Encapsulating Objects with Confined Types,” TOPLAS, vol. 29, no. 6, 2007.
[32]
S. Nägeli, “Ownership in design patterns,” Master’s thesis, Software Component Technology Group, Department of CS, ETH Zurich, 2006.
[33]
G. Cele and S. Stureborg, “Ownership types in practice,” Master’s thesis, Department of CSS, Stockholm University, Jan. 2005.
[34]
B. Liskov and J. V. Guttag, Abstraction and Specification in Program Development. MIT Press/McGraw-Hill, 1986.

Cited By

View all
  • (2013)The need for capability policiesProceedings of the 15th Workshop on Formal Techniques for Java-like Programs10.1145/2489804.2489811(1-7)Online publication date: 1-Jul-2013

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICSE '13: Proceedings of the 2013 International Conference on Software Engineering
May 2013
1561 pages
ISBN:9781467330763

Sponsors

Publisher

IEEE Press

Publication History

Published: 18 May 2013

Check for updates

Qualifiers

  • Research-article

Conference

ICSE '13
Sponsor:

Acceptance Rates

Overall Acceptance Rate 276 of 1,856 submissions, 15%

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)4
  • Downloads (Last 6 weeks)0
Reflects downloads up to 02 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2013)The need for capability policiesProceedings of the 15th Workshop on Formal Techniques for Java-like Programs10.1145/2489804.2489811(1-7)Online publication date: 1-Jul-2013

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media