Optimizing the Java Piped I/O Stream Library for Performance

  • Ji Zhang
  • Jaejin Lee
  • Philip K. McKinley
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2481)


The overall performance of Java programs has been significantly improved since Java emerged as a mainstream programming language. However, these improvements have revealed a second tier of performance bottlenecks. In this paper, we address one of these issues: the performance of Java piped I/O stream library. We analyze commonly used data transfer patterns in which one reader thread and one writer thread communicate via Java piped I/O streams. We consider data buffering and synchronization between these two threads, as well as the thread scheduling policy used in the Java virtual machine. Based on our observations, we propose several optimization techniques that can significantly improve Java piped I/O stream performance. We use these techniques to modify the Java piped I/O stream library. We present performance results for seven example programs from the literature that use the Java piped I/O stream library. Our methods improve the performance of the programs by over a factor of 4 on average, and by a factor of 27 in the best case.


Packet Size Mobile Host Java Program Normalize Execution Time Java Virtual Machine 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Badrinath, B.R., Bakre, A., Marantz, R., Imielinski, T.: Handling mobile hosts: A case for indirect interaction. In: Proc. Fourth Workshop on Workstation Operating Systems, Rosario, Washington. IEEE, Los Alamitos (1993)Google Scholar
  2. 2.
    Chawathe, Y., Fink, S., McCanne, S., Brewer, E.: Aproxy architecture for reliable multicast in heterogeneous environments. In: Proceedings of ACM Multimedia 1998, Bristol, UK (September 1998)Google Scholar
  3. 3.
    Roussopoulos, M., Maniatis, P., Swierk, E., Lai, K., Appenzeller, G., Baker, M.: Person-level routing in the mobile people architecture. In: Proceedings of the 1999 USENIX Symposium on Internet Technologies and Systems, Boulder, Colorado (October 1999)Google Scholar
  4. 4.
    Yang, L., Hofmann, M.: OPES architecture for rule processing and service execution (February 2001), Internet Draft draft-yang-opes-rule-processing-service-execution-00.txt
  5. 5.
    McKinley, P.K., Padmanabhan, U.I., Ancha, N.: Experiments in composing proxy audio services for mobile users. In: Guerraoui, R. (ed.) Middleware 2001. LNCS, vol. 2218, pp. 99–120. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  6. 6.
    Campione, M., Walrath, K., Huml, A.: The Java Tutorial: A Short Course on the Basics, 3rd edn. Addison-Wesley, Reading (2001)Google Scholar
  7. 7.
    Sun Microsystems, Multithreaded programming guide. 806-5257-1 (January 2001)Google Scholar
  8. 8.
    Campione, M., Walrath, K.: The Java Tutorial: Object-Oriented Programming for the Internet, 1st edn. Addison-Wesley, Reading (1996) (Online Version)Google Scholar
  9. 9.
    Gagnon, R.: Ral’s how to: Java thread,
  10. 10.
    Java Power, Java power scratch book,
  11. 11.
    Kramer, D., Chan, P., Lee, R.: The Java(TM) Class Libraries, 2nd edn., vol. 1. Addison-Wesley, Reading (1998)Google Scholar
  12. 12.
    Weber, J.: Special Edition Using Java. Que (November 1996)Google Scholar
  13. 13.
    Harold, E.R.: Java I/O. O’Reilly & Associates (March 1999)Google Scholar
  14. 14.
    Hyde, P.: Java Thread Programming. SAMS (August 1999)Google Scholar
  15. 15.
    Sun Microsystems, Java 2 SDK for solaris developer’s guide. 06-1367-10 (February 2000) Google Scholar
  16. 16.
    Austin, C.: Java technology on the Linux platform: A guide to getting started (October 2000),
  17. 17.
    Sun Microsystems, Java on Solaris 7 developer’s guide, 805-4031 (1998) Google Scholar
  18. 18.
    Guyer, S.Z., Lin, C.: Optimizing the use of high performance software libraries. In: Midkiff, S.P., Moreira, J.E., Gupta, M., Chatterjee, S., Ferrante, J., Prins, J.F., Pugh, B., Tseng, C.-W. (eds.) LCPC 2000. LNCS, vol. 2017, pp. 227–243. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  19. 19.
    Aldrich, J., Chambers, C., Sirer, E.G., Eggers, S.J.: Static analyses for eliminating unnecessary synchronization from Java programs. In: Static Analysis Symposium, pp. 19–38 (1999)Google Scholar
  20. 20.
    Ruf, E.: Effective synchronization removal for java. In: ACM SIGPLAN Conference on Programming Language Design and Implementation (June 1999)Google Scholar
  21. 21.
    Boyapati, C., Rinard, M.: A parameterized type system for race-free Javaprograms. In: 16th Annual Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA (2001)Google Scholar
  22. 22.
    Goetz, B.: Tweak your IO performance for faster runtime: increase the speed of Java programs by tuning IO performance, Java World (November 2000)Google Scholar
  23. 23.
    McCluskey, G.: Java I/O performance; login: - The Magazine of USENIX&SAGE (December 1998),
  24. 24.
    McCluskey, G.: Tuning Java I/O performance (March 1999),

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Ji Zhang
    • 1
  • Jaejin Lee
    • 2
  • Philip K. McKinley
    • 1
  1. 1.Department of Computer Science and Engineering, Software Engineering and Network Systems LaboratoryMichigan State UniversityEast LansingUSA
  2. 2.School of Computer Science and EngineeringSeoul National UniversitySeoulKorea

Personalised recommendations