An In-Depth Examination of Java I/O Performance and Possible Tuning Strategies Kai Xu Hongfei Guo

Slides:



Advertisements
Similar presentations
Hardware Lesson 3 Inside your computer.
Advertisements

1 Streams and Input/Output Files Part I. 2 Introduction So far we have used variables and arrays for storing data inside the programs. This approach poses.
Jan Java I/O Yangjun Chen Dept. Business Computing University of Winnipeg.
1 Parallel Scientific Computing: Algorithms and Tools Lecture #2 APMA 2821A, Spring 2008 Instructors: George Em Karniadakis Leopold Grinberg.
Multi-Level Caches Vittorio Zaccaria. Preview What you have seen: Data organization, Associativity, Cache size Policies -- how to manage the data once.
4/5/20001 Windows 2000 IO Performance Leonard Chung & Jim Gray.
Files Files are used to store long term data. –Typically referred to as persistent data. –A file is a group of related records. –A list of friends addresses.
External Sorting CS634 Lecture 10, Mar 5, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
 We can use a combination of the File and FileOutputStream to write a series of bytes to a file.
ISCSI Performance in Integrated LAN/SAN Environment Li Yin U.C. Berkeley.
CS 61C L35 Caches IV / VM I (1) Garcia, Fall 2004 © UCB Andy Carle inst.eecs.berkeley.edu/~cs61c-ta inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L07 (Chapter 18) Binary I/O.
Overview: Memory Memory Organization: General Issues (Hardware) –Objectives in Memory Design –Memory Types –Memory Hierarchies Memory Management (Software.
CHEP ' 2003David Chamont (CMS - LLR)1 Twelve Ways to Build CMS Crossings from Root Files Benefits and deficiencies of Root trees and clones when : - NOT.
Lab 2 Data Streams. Lab 2: Data Streams Introduction Reading from an Input Stream Writing to an Output Stream Filter Streams.
13-Jul-15 Getting Ready for Java. 2 What You Need 256 MB of RAM (512 MB or more recommended) 500 MHz Pentium or better Macintosh: must run Mac OS X, preferably.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Java I/O Input: information brought to program from an external source
Protocol Analysis of PPlive and PPstream by Internet Measurement Yunfei Zhang China Mobile
© Stavros Harizopoulos 2006 Performance Tradeoffs in Read-Optimized Databases Stavros Harizopoulos MIT CSAIL joint work with: Velen Liang, Daniel Abadi,
Simply Connecting the World ViewlinX Manager HW/SW Overview Installation Users File, View, Window.
On Windows File Access Modes : A Performance Study Jalil Boukhobza & Claude Timsit laboratory Versailles Saint Quentin University.
Files and Streams. Java I/O File I/O I/O streams provide data input/output solutions to the programs. A stream can represent many different kinds of sources.
Profiling Grid Data Transfer Protocols and Servers George Kola, Tevfik Kosar and Miron Livny University of Wisconsin-Madison USA.
Roopa.T PESIT, Bangalore. Source and Credits Dalvik VM, Dan Bornstein Google IO 2008 The Dalvik virtual machine Architecture by David Ehringer.
Performance Tradeoffs in Read-Optimized Databases Stavros Harizopoulos * MIT CSAIL joint work with: Velen Liang, Daniel Abadi, and Sam Madden massachusetts.
Sensitivity of Cluster File System Access to I/O Server Selection A. Apon, P. Wolinski, and G. Amerson University of Arkansas.
1 Wenguang WangRichard B. Bunt Department of Computer Science University of Saskatchewan November 14, 2000 Simulating DB2 Buffer Pool Management.
JPCM - JDC121 JPCM. Agenda JPCM - JDC122 3 Software performance is Better Performance tuning requires accurate Measurements. JPCM - JDC124 Software.
Amy Apon, Pawel Wolinski, Dennis Reed Greg Amerson, Prathima Gorjala University of Arkansas Commercial Applications of High Performance Computing Massive.
JAVA I/O © EnhanceEdu, IIIT Hyderabad. Contents 3/29/2010EnhanceEdu, IIIT - H 2  Command Line I/O  File Class  Streams  Byte Streams [Low level and.
Inside your computer. Hardware Review Motherboard Processor / CPU Bus Bios chip Memory Hard drive Video Card Sound Card Monitor/printer Ports.
Inside your computer. Hardware Motherboard Processor / CPU Bus Bios chip Memory Hard drive Video Card Sound Card Monitor/printer Ports.
CS Operating System & Database Performance Tuning Xiaofang Zhou School of Computing, NUS Office: S URL:
Applications Development Input and Output in Java Topics covered: Some input-output capabilities of Java Example input code Java.
5/8/09 Titanium Performance Update 2 Dot Hill Confidential.
Thursday 8 th October, 2015 Information Technology Fundamentals of Hardware & Software.
Streams & Files. Java I/O Classes Saving data to / Loading data from files Two Choices: Binary-Formatted or Text-Formatted Data – int x = 1234; – Binary.
The HDF Group HDF5 Chunking and Compression Performance tuning 10/17/15 1 ICALEPCS 2015.
FITSIO, HDF4, NetCDF, PDB and HDF5 Performance Some Benchmarks Results Elena Pourmal Science Data Processing Workshop February 27, 2002.
1 Exceptions Exception handling – Exception Indication of problem during execution – E.g., divide by zero – Chained exceptions Uses of exception handling.
PROOF Benchmark on Different Hardware Configurations 1 11/29/2007 Neng Xu, University of Wisconsin-Madison Mengmeng Chen, Annabelle Leung, Bruce Mellado,
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 13 Java Fundamentals File I/O Serializing an.
Personal Computers: in the 1990’s Presenter: Michael Verhaart Use [PageDown] to proceed or in Full screen mode (right click for menu) use Left click mouse.
1 Putting Streams to use. 2 Stream Zoo C++ gives you istream, ostream, iostream, ifstream, ofstream, fstream, wistream, wifstream, istrsteam… (18) Java.
Computer Performance. Hard Drive - HDD Stores your files, programs, and information. If it gets full, you can’t save any more. Measured in bytes (KB,
LIOProf: Exposing Lustre File System Behavior for I/O Middleware
1© Copyright 2015 EMC Corporation. All rights reserved. NUMA(YEY) BY JACOB KUGLER.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Operating Systems.
Chapter 3 Getting Started. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Objectives To give an overview of the structure of a contemporary.
CS202 Java Object Oriented Programming Input and Output Chengyu Sun California State University, Los Angeles.
Java IO Exploring the java.io package and living to talk about it.
java.io supports console and file I/O
The Java IO System Different kinds of IO Different kinds of operations
IO in java.
Files and Streams The material in this chapter is not tested on the AP CS exams.
CSG2H3 Object Oriented Programming
BINARY I/O IN JAVA CSC 202 November What should be familiar concepts after this set of topics: All files are binary files. The nature of text files.
Exception Handling, Reading and Writing in Files, Serialization,
Lecture 1 Runtime environments.
Chapter 17 Binary I/O 1.
Chapter 17 Binary I/O Dr. Clincy - Lecture.
JAVA IO.
Tools.
Outline Motivation and background Read Write
Tools.
Files and Streams in Java
Web Design & Development Lecture 8
CSE 332: Data Abstractions Memory Hierarchy
David Davenport Spring 2005
Presentation transcript:

An In-Depth Examination of Java I/O Performance and Possible Tuning Strategies Kai Xu Hongfei Guo

Outline Why bother? (Problems) Our goals Java I/O overview Tests design Test results and analysis Conclusions

Why bother? Growing interest in using Java Much works had been done in Java performance evaluation but NOT in Java I/O

Our Goals Is it really bad (Compared with C/C++) How bad Possible tuning strategies How well they work

Random AccessFile OutputStreamInputStream FileOutputStream FilterOutputStream ByteArrayOutputStream BufferedOutputStream DataOutputStream FileInputStream FilterInputStream ByteArrayInputStream BufferedInputStream DataInputStream An Overview of Java I/O Classes

Test Design Access patterns Sequential write/read Random write/read Data interested Elapse time, CPU breakdown Comparison group: C/C++

Test Design (continued) Tests on basic Java I/O strategies Test 1: The lowest level I/O Test 2: Buffered I/O Test 3: Direct buffering Test 4: Operation size Test 5: Java JNI

Test Setup Hardware configuration CPU: Pentium III 667 MHz Memory: 128 MB Disk: 10 GB IDE Software configuration OS : Redhat 6.2 JVM : JDK Profiling Tools: PerfAnal profiler, gprof profiler 2.9.5, time

Test 1: The lowest level Java I/O Test parameters: buffer size : 0 Byte operation size : 1 Byte Sequential Write/Read Random Write/Read

Sequential Write/Read

Breakdown -- File size: 100M

Random Write/Read

Breakdown -- File size: 10M

Test 1 Analysis Java raw I/O: 200%x slower Java system calls cost more  read :224%x  write: 158%x Random Access is similar

Test 2: Buffered I/O in Java Test parameters: buffer size : 1024 Bytes file size : 100 MB Sequential Write/Read Buffering Strategies:  No Buffering: (FileInputStream/FileOutputStream)  BufferedInputStream/BufferedOutputStream  Direct Buffering

Buffering Strategies in Java

CPU Breakdown

Test 2 Analysis Buffering improves I/O reducing system calls Buffered Stream: ~25% Direct Buffering: ~40% special purpose vs. general purpose No buffering for random access

Test 3: Direct Buffering Test parameters: file size : 100 MB operation size : 1 Byte Sequential Write/Read Random Write/Read

Sequential Write/Read

Breakdown – Java

Breakdown – C

Random Write/Read

Breakdown – Java

Breakdown – C

Test 3 Analysis Direct buffering improves I/O: ~50% reducing system calls slower than C/C++: ~300% Larger buffer? no big gain : Amdahl’s law! Does not help in random access  low hit ratio: less than 1%

Test 4: Operation Size Test parameters: buffer size : 0 Byte Sequential Write/Read Random Write/Read

Sequential Write/Read: 100M

Random Write/Read: 10M

Test 4 Analysis Increasing operation size helps: ~ 85% reducing I/O system calls comparable to C/C++ Large operation size –no big gain. Random Access is similar

Test 5: Java JNI Test parameters: file size : 100 MB buffer size : 4 KB Sequential Write/Read

Java JNI Buffering

Breakdown – JNI buffering

Test 5 Analysis I/O system calls are cheap (C/C++ level); But, cost of calling native method is high; Small operation size:  more native calls,  comparable to Direct Buffering; Large operation size: less native calls, comparable to C/C++.

Conclusions Java raw I/O: 200%x slower than C Buffering improves I/O  Reducing system calls  220% improvement vs. no buffer  But, still 364%x slower than C Random I/O – no help with buffering? – locality of access;

Conclusions (continued) Increasing operation size helps Comparable to C/C++ JNI  system calls are cheap (C/C++ level);  cost of calling native method is high;  reduce native call times: Comparable to C/C++

Thank You…