Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikolairuhe/layerperformance
https://github.com/nikolairuhe/layerperformance
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nikolairuhe/layerperformance
- Owner: NikolaiRuhe
- Created: 2011-05-03T08:17:04.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-01-29T08:42:24.000Z (almost 12 years ago)
- Last Synced: 2023-03-11T22:41:50.812Z (almost 2 years ago)
- Language: Objective-C
- Homepage:
- Size: 105 KB
- Stars: 13
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
LayerPerformance
================This project illustrates the ideas presented in [this stackoverflow post](http://stackoverflow.com/questions/5847876/whats-the-best-approach-to-draw-lines-between-views/5848118#5848118).
It is a simple iPad app intended to measure the difference between Core Graphics rendering and Core Animation (layer based) rendering. The app shows a number of draggable dots, connected by lines. When a dot is moved, the connected lines are updated to follow the dot. There are two implementations with vastly different performance and memory consumption: Core Graphics and Core Animation.
![screenshot and instruments results](http://i.stack.imgur.com/vqNwO.png)
### Core Graphics
Core Graphics is used to create the lines. The layer is extended to the bounding
box of the line. The contents are drawn using Core Graphics functions.### Core Animation
The layer is filled with the line color and resized, positioned and rotated to
exactly cover the area of the line. No CPU based redraw is needed for this drawing
mode.As expected, the performance of Core Animation based drawing is drastically better
than for Core Graphics based drawing. Also, the memory footprint is considerably
lower.