Chapter 10: Performance Patterns

Similar documents
Design Patterns. An introduction

Design Patterns. Gunnar Gotshalks A4-1

Chapter 12 (revised by JAS)

Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software

Work groups meeting 3

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1

Patterns of learning

Object Oriented Methods with UML. Introduction to Design Patterns- Lecture 8

CSC7203 : Advanced Object Oriented Development. J Paul Gibson, D311. Design Patterns

CS/CE 2336 Computer Science II

Lecture 13: Design Patterns

Goals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming

Pattern Resources. Lecture 25: Design Patterns. What are Patterns? Design Patterns. Pattern Languages of Programming. The Portland Pattern Repository

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

Crash course on design patterns

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University

be used for more than one use case (for instance, for use cases Create User and Delete User, one can have one UserController, instead of two separate

CHAPTER 6: CREATIONAL DESIGN PATTERNS

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar

Coordination Patterns

More on Design. CSCI 5828: Foundations of Software Engineering Lecture 23 Kenneth M. Anderson

Outline. Design Patterns. Observer Pattern. Definitions & Classifications

Using Design Patterns in Java Application Development

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

CPSC 310 Software Engineering. Lecture 11. Design Patterns

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1

As a programmer, you know how easy it can be to get lost in the details

Slide 1. Design Patterns. Prof. Mirco Tribastone, Ph.D

Work groups meeting 3

3 Product Management Anti-Patterns by Thomas Schranz

Model-View-Controller

Applying the Observer Design Pattern

A Rapid Overview of UML

Cocoa Design Patterns. Erik M. Buck October 17, 2009

COSC 6374 Parallel Computation. Parallel Design Patterns. Edgar Gabriel. Fall Design patterns

Design Patterns. CSC207 Fall 2017

Foundations of Software Engineering Design Patterns -- Introduction

DESIGN PATTERN - INTERVIEW QUESTIONS

Refactoring. Why? When? What?

An Introduction to Patterns

CS250 VLSI Systems Design Lecture 8: Introduction to Hardware Design Patterns

MVC. Model-View-Controller. Design Patterns. Certain programs reuse the same basic structure or set of ideas

Patterns. Erich Gamma Richard Helm Ralph Johnson John Vlissides

Object Oriented Paradigm

Lecture 19: Introduction to Design Patterns

Applying Design Patterns to accelerate development of reusable, configurable and portable UVCs. Accellera Systems Initiative 1

Tuesday, October 4. Announcements

OPERATING SYSTEM SUPPORT (Part 1)

Design Patterns (DP) In the beginning. It s not a course about DP (just a little) A lot of good design and efficient implementation is based on DP

Design patterns. Valentina Presutti courtesy of Paolo Ciancarini

C++ INTERFACE CLASSES STRENGTHENING ENCAPSULATION

Topics in Object-Oriented Design Patterns

Best Practices. Deploying Optim Performance Manager in large scale environments. IBM Optim Performance Manager Extended Edition V4.1.0.

Inheritance. EEC 521: Software Engineering. Dealing with Change. Polymorphism. Software Design. Changing requirements Code needs to be flexible

1 Software Architecture

Recitation 13. Software Engineering Practices and Introduction to Design Patterns

The Software Design Process. CSCE 315 Programming Studio, Fall 2017 Tanzir Ahmed

Design Patterns. CSC207 Winter 2017

Applying the Decorator Design Pattern

CPS122 Lecture: Design Patterns Last revised March 20, 2012

Introduction and History

Review Software Engineering October, 7, Adrian Iftene

Programação de Sistemas Distribuidos

EE382N (20): Computer Architecture - Parallelism and Locality Spring 2015 Lecture 14 Parallelism in Software I

Multiprocessor scheduling

2.1 Design Patterns and Architecture (continued)

X-S Framework Leveraging XML on Servlet Technology

Application Architectures, Design Patterns

2.1 Design Patterns and Architecture (continued)

IX: A Protected Dataplane Operating System for High Throughput and Low Latency

A Reconnaissance on Design Patterns

Multiprocessor and Real-Time Scheduling. Chapter 10

Advanced Object Oriented PHP

w3.ualg.pt/~jvo/poo

Design Patterns For Object Oriented Software Development Acm Press

Software Engineering

CHAPTER 6: CREATIONAL DESIGN PATTERNS

Design Patterns. James Brucker

PATTERNS AND SOFTWARE DESIGN

ECE519 Advanced Operating Systems

Major travel and hospitality organizations often have

Facade and Adapter. Comp-303 : Programming Techniques Lecture 19. Alexandre Denault Computer Science McGill University Winter 2004

Intro to Transactions

CS211 Lecture: Design Patterns Last revised November 30, 2007

Design patterns. OOD Lecture 6

06-Dec-17. Credits:4. Notes by Pritee Parwekar,ANITS 06-Dec-17 1

ECE/CS 757: Homework 1

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

Design Patterns. Definition of a Design Pattern

What is a Pattern? Lecture 40: Design Patterns. Elements of Design Patterns. What are design patterns?

APPLYING DESIGN PATTERNS TO SCA IMPLEMENTATIONS

Object Design II: Design Patterns

Copyright 2018, Oracle and/or its affiliates. All rights reserved.

Lecture 14: Congestion Control"

Object Oriented Programming. Michał Bereta

Patterns of Parallel Programming with.net 4. Ade Miller Microsoft patterns & practices

Object-Oriented Design & Patterns By Cay S. Horstmann READ ONLINE

Lectures 24 and 25 Introduction to Architectural Styles and Design Patterns

Design Patterns. Observations. Electrical Engineering Patterns. Mechanical Engineering Patterns

Transcription:

Chapter 10: Performance Patterns

Patterns A pattern is a common solution to a problem that occurs in many different contexts Patterns capture expert knowledge about best practices in software design in a form Allows knowledge to be reused Applied in design of many different types of software Pattern address the problem of reinventing the wheel SOFT 437 Chapter 10 2

History of Patterns The use of patterns in software development has its roots in the work of Christopher Alexander, an architect: Each patterns describes a problem which occurs over and over again in our environments, and then describes the core of the solution to that problem, in such a way that you can use this solution in million times over, without ever doing it the same way twice. SOFT 437 Chapter 10 3

Design Patterns In the late 1980s, several people in the software development community began to apply Alexander s ideas to software Design Patterns: Elements of Reusable Object- Oriented Software, by Erich Gamma, Richard helm, Ralph Johnson, and John Vlissides (the Gang of Four) Design patterns identify abstractions that are at a higher level than individual classes and objects Construct the software using patterns Singleton Pattern, Proxy Pattern SOFT 437 Chapter 10 4

Most popular book in Computer Science Sold over one million copies in print SOFT 437 Chapter 10 5

History of Eclipse 1997 VisualAge for Java ( implemented in small talk) 1999 -- VisualAge for Java Micro- Edition (code based from here) 2001 Eclipse (change name for marketing issue) 2003 Eclipse.org 2005- Eclipse V3.1 2006- Eclipse V3.2 SOFT 437 Chapter 10 6

Architecture of Eclipse The eclipse plug-in architecture increase modularity Everything is a plug-in Extension points its component configuration points SOFT 437 Chapter 10 7

Performance Patterns The performance patterns describe best practices for producing responsive, scalable software Performance patterns complement and extend the performance principles Seven performance patterns address performance and scalability Fast Path Alternate Routes First Things First Flex time Coupling Slender Cyclic Batching Functions SOFT 437 Chapter 10 8

Performance Patterns vs. Design Patterns Each performance pattern is a realization of one or more of the performance principles The performance patterns are at a higher level of abstraction than design patterns A design pattern may provide an implementation of a performance pattern level of abstraction Performance Principles Performance Patterns Design Patterns Centering Principles Fast Path Proxy SOFT 437 Chapter 10 9

Pattern Template Each pattern is defined in a standard template: Name: The title of the subsection Problem: What is motivating us to apply this pattern? Solution: How do we solve the problem? Benefits: What are the potential positive outcomes of applying this pattern? Consequences: What are the potential shortcomings and consequences of applying this patterns? SOFT 437 Chapter 10 10

Fast Path Concerned with improving response time by reducing the amount of processing required for dominant workloads Example: menus in automated telephone system Problem: dominant workload Solution: Create an express train that stops only at the most important stations along the route Identify the data most frequently used together Implemented by Proxy patterns Based mainly on the centering principle SOFT 437 Chapter 10 11

myimage SOFT 437 Chapter 10 12

Fast Path (Con t) Benefits: Reduces the response time for dominant workload functions by reducing the amount of processing required for the most frequent uses of the software Reduces the overall load on the system by avoiding some resource consumption Consequences: It is not enough to recognize the need for the Fast Path you must also ensure that it is likely to be used Usage patterns change over time Use the instrumenting principle to monitor usage patterns, and adapt your system to changing patterns SOFT 437 Chapter 10 13

First Things First Focus on the important processing tasks to ensure that, if everything cannot be completed within the time available, then the least important tasks will be the ones omitted Problem: Temporary overload may cause input data to be lost or response times to be unacceptably slow Example: online-trading Solution: Assign priorities to tasks and execute them so that the most important activities receive preference Example: transaction of billions of dollars Use the Centering Principle to focus attention on the most important work SOFT 437 Chapter 10 14

Benefits First Things First (Con t) Focuses on the most important tasks and ensures that they complete Maximizes the quality of service of the system and improves scalability Consequences Only appropriate if the overload is temporary If the overload is not temporary, reduce the amount of processing required by other means or upgrade the processing environment SOFT 437 Chapter 10 15

Coupling Match the interface of an object with its most frequent uses Problem: Applications use fine-grained objects to request remote information The number of interactions is large Cost of remote calls is high in distributed systems Responsiveness is poor in multi-tier Web applications Using a class structure identical to the physical database schema can lead to performance problems SOFT 437 Chapter 10 16

Coupling (Con t) Solution: Use more coarse-grained objects to eliminate frequent requests for small amount of information The best way of constructing the aggregation will depend on the access patterns for the data Data that is frequently accessed at the same time should be grouped into an aggregation Use the Centering Principle to identify interfaces Use the Locality Principle to combine information Use the Processing vs. Frequency Principle to minimize the total processing required for the interface SOFT 437 Chapter 10 17

Last Name: First Name: Customer Number: Last Name: Last Name: Last Name: Order Date: Delivery Date: : : : : Customer Address: Pay by Credit Card Pay by Cash or Check Credit Status: Order item: SOFT 437 Chapter 10 18 Product Name: Available Order item: Product Code:

Benefits: Coupling (Con t) Match the business tasks to the processing required to accomplish them Reduce the total resource requirements of the system Consequences: Start by identifying information that is stable, and use those objects to reduce the amount of communication overhead required to obtain data SOFT 437 Chapter 10 19

Batching Combines frequent requests for services to save the overhead of initialization, transmission, and termination processing for the request Problem: Requested tasks require considerable overhead processing for initialization, termination, and in distributed systems, for transmitting data and requests For very frequent tasks, the amount of time spent in overhead processing may exceed the amount of real processing on the system Example Insert new rows Send secured messages SOFT 437 Chapter 10 20

Solution: Batching (Con t) Combine the requests into batches so the overhead processing is executed once for the entire batch instead of for each individual item Sender-side batching (e.g., insert new rows) Receiver-side batching (e.g., transfer secured messages over links) Using the Processing vs. Frequency Principle to minimize the product of the processing times the frequency of requests SOFT 437 Chapter 10 21

Benefits: Batching (Con t) Reduce the total amount of processing required for all tasks Improve responsiveness by reducing the contention delay Improve scalability by freeing up resources Consequences: Batching is appropriate for frequent tasks that require a large amount of overhead processing Batching is most effective when the amount of overhead and the frequency of requests are both high SOFT 437 Chapter 10 22

Alternate Routes Spread the demand for high-usage objects spatially to different objects or locations Reduce contention delays for the objects Problems: Occurs frequently in database systems when many processes need exclusive access to the same physical location, usually to execute an update Happens when several processes must coordinate with a single concurrent process When a single dispatching process receives inbound requests and determines which subsequent process is to handle the request SOFT 437 Chapter 10 23

Solution: Alternate Routes (Con t) Find an alternate route for the processing In database access situation, find a way for the access to go to different physical locations For the process coordination problems, find a way to route requests to different processes For the one-inbound dispatcher problem, use multiple instances of the dsipatcher Use the Spread-the-Load Principle SOFT 437 Chapter 10 24

Benefits: Alternate Routes (Con t) Reduces delays due to serialization Improves responsiveness and scalability Reduces the variability in performance Consequences: Make sure that your alternate route effectively spreads the load spatially SOFT 437 Chapter 10 25

Flex Time Spread the demand for high-usage objects temporally to a different period of time Reduce contention delays for the objects Problems: Processing is required at a particular frequency, or at a particular time of day Users are allowed to select the time of day when they want the reports, but are all given the same choices for time of day SOFT 437 Chapter 10 26

Flex Time (Con t) Solution: Identify the functions that execute repeatedly at regular, specific time intervals, and modify the time of their processing Solution to the time-of-day problem is to move the processing to a different time of day Solution to the processing-time-choice problem is to generate a random number for the selection choices Solution to the periodic processing problem is to do less work more often Apply the Spread-the-Load Principles SOFT 437 Chapter 10 27

Flex Time (con t) Benefits: Spread the load temporally to reduce the congestion Reduces the amount of time that processes are blocked and cannot proceed Reduces the resource demand so that concurrent process encounter fewer queueing delays for computer resources Consequences: Some of the Flex Time solutions require more processing The net effect is to reduce the time that processes wait in queues The Flex Time has the same potential problem as Alternate Routes if everyone chooses the same alternate time, you have a new bottleneck SOFT 437 Chapter 10 28

Slender Cyclic Functions Concerned with processing that must execute at regular intervals Problem: A cyclic or periodic function is characterized by its: Period: the amount of time between successive executions Execution time: the amount of time required for the function to execute Slack time: the amount of time between the completion of execution and the end of the period SOFT 437 Chapter 10 29

Slender Cyclic Functions (Con t) Solution: Identify the functions that execute repeatedly at regular, specific time intervals, and minimize their processing requirements Use both the Centering Principle and the Shared Resources Principles Benefits: Reduce the processing requirements so that we have more resources available to share and thus reduce queueing delays SOFT 437 Chapter 10 30

Slender Cyclic Functions (Con t) Consequences: Operating conditions may change over time The cycle frequency may need to change, or the amount of processing per cycle may change Instrument systems and monitor their performance over time for early warning of potential problems SOFT 437 Chapter 10 31