Performance Patterns
Definition: a pattern is a common solution that appears in many different contexts.
- Captures expert knowledge.
- Solves ?reinventing the wheel.?
- Identifiy abstractions.
Performance patterns: higher level than design patterns.
Fast Path
- Some things are done more often than others, so streamline these operations (i.e. shorten the critical path).
- Defer other operations if possible.
- Other Benefits
- Spreads the load out in time, or avoids it altogether.
Caveat Emptor!
- Be sure the fast path is the actual path being used!
First Things First
- Things which matter most should never be at the mercy of things which matter least. (Goethe)
- Same as in time management: prioritize!
Caveat Emptor!
- This only works if overloads are temporary.
Coupling
- Make the interface match the application. (Especially for distributed applications as RPC calls are expensive!)
- batch up requests into one call.
Caveat Emptor!
- A new application may have a lot of churn.
Batching
- Combine multiple similar requests into one big request.
- Overhead of processing requests is amortized over the batch.
- Benefits
- Reduces overall demand.
Caveat Emptor!
- Batching infrequent requests will cause unnecessary delays.
- Batching itself may cause more delays.
Alternate Routes
- Spread demand for high-usage objects spatially.
- partition the data.
- route requests to different processes.
Caveat Emptor!
- If all requests take the same route, you?re no better off.
Flex Time
- Spread the demand temporally.
- i.e. Run jobs later when there is less demand.
- Or, run them ahead of time and save results.
Benefits:
- Lower queueing delays overall.
Caveat Emptor:
- May actually increase total demand.
Slender Cyclic Functions
- (common in embedded real-time systems).
- Minimize the time spent in periodic functions.
- Push as much processing as possible into non-time-critical functions.
Additional Information
There are no comments on this page. [Add comment]