From 394673aa275fdab9a5628f5c59cebef2296f52c7 Mon Sep 17 00:00:00 2001 From: Jiawei Wang Date: Fri, 4 Mar 2016 17:17:27 +0800 Subject: [PATCH] Update README.md --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 21ab4fa..eea95a7 100644 --- a/README.md +++ b/README.md @@ -28,40 +28,40 @@ view.addSubview(imageView) ####1.Display just one GIF image ####1.1 CPU usgae: ######JWAnimatedImage

-![JW_CPU](https://raw.githubusercontent.com/wangjwchn/JWAnimatedImage/master/BenchmarkPicture/JW_CPU1.png)

+![JW_CPU](https://raw.githubusercontent.com/wangjwchn/BenchmarkImage/master/JW_CPU1.png)

######FLAnimatedImage

-![FL_CPU](https://raw.githubusercontent.com/wangjwchn/JWAnimatedImage/master/BenchmarkPicture/FL_CPU1.png)

+![FL_CPU](https://raw.githubusercontent.com/wangjwchn/BenchmarkImage/master/FL_CPU1.png)

######SwiftGif

-![SG_CPU](https://raw.githubusercontent.com/wangjwchn/JWAnimatedImage/master/BenchmarkPicture/SG_CPU.png)

+![SG_CPU](https://raw.githubusercontent.com/wangjwchn/BenchmarkImage/master/SG_CPU.png)

####1.2 Memory usage: ######JWAnimatedImage

-![JW_MEM](https://raw.githubusercontent.com/wangjwchn/JWAnimatedImage/master/BenchmarkPicture/JW_MEM1.png)

+![JW_MEM](https://raw.githubusercontent.com/wangjwchn/BenchmarkImage/master/JW_MEM1.png)

######FLAnimatedImage

-![FL_MEM](https://raw.githubusercontent.com/wangjwchn/JWAnimatedImage/master/BenchmarkPicture/FL_MEM1.png)

+![FL_MEM](https://raw.githubusercontent.com/wangjwchn/BenchmarkImage/master/FL_MEM1.png)

######SwiftGif

-![SG_MEM](https://raw.githubusercontent.com/wangjwchn/JWAnimatedImage/master/BenchmarkPicture/SG_MEM.png)

+![SG_MEM](https://raw.githubusercontent.com/wangjwchn/BenchmarkImage/master/SG_MEM.png)

> I've discussed the high memory usage of FLAnimatedImage with [@mitchellporter](https://github.com/mitchellporter) and confirmed this problem does exist,you can see it [here](https://github.com/wangjwchn/JWAnimatedImage/issues/1)

> From the graph,we can see that SwiftGif isn't processing the memory usage.

####2.Display 30 GIF images ####Like this: -![DEMO](https://raw.githubusercontent.com/wangjwchn/JWAnimatedImage/master/BenchmarkPicture/DEMO.jpg)

+![DEMO](https://raw.githubusercontent.com/wangjwchn/BenchmarkImage/master/DEMO.jpg)

####2.1 CPU usgae: ######JWAnimatedImage

-![JW_CPU](https://raw.githubusercontent.com/wangjwchn/JWAnimatedImage/master/BenchmarkPicture/JW_CPU2.png)

+![JW_CPU](https://raw.githubusercontent.com/wangjwchn/BenchmarkImage/master/JW_CPU2.png)

######FLAnimatedImage

-![FL_CPU](https://raw.githubusercontent.com/wangjwchn/JWAnimatedImage/master/BenchmarkPicture/FL_CPU2.png)

+![FL_CPU](https://raw.githubusercontent.com/wangjwchn/BenchmarkImage/master/FL_CPU2.png)

###### ......

-![FL_CPU](https://raw.githubusercontent.com/wangjwchn/JWAnimatedImage/master/BenchmarkPicture/FL_CPU3.png)

+![FL_CPU](https://raw.githubusercontent.com/wangjwchn/BenchmarkImage/master/FL_CPU3.png)

> There is no benckmark graph for SwiftGif because it crash immediately caused by high memory usage.

> For each image,FLAnimatedImage create a new thread and run independently.From the graph,we can see there are 36 threads when we load 30 GIF images,that will cause a heavy CPU usage.

> So in JWAnimatedImage,we use 'global queue' by 'GCD' to handle these tasks together.That makes the number of threads down to 10,and those threads are dynamic.From the graph,we can see some of them are just start.

####2.2 Memory usage: ######JWAnimatedImage

-![JW_MEM](https://raw.githubusercontent.com/wangjwchn/JWAnimatedImage/master/BenchmarkPicture/JW_MEM2.png)

+![JW_MEM](https://raw.githubusercontent.com/wangjwchn/BenchmarkImage/master/JW_MEM2.png)

######FLAnimatedImage

-![FL_MEM](https://raw.githubusercontent.com/wangjwchn/JWAnimatedImage/master/BenchmarkPicture/FL_MEM2.png)

+![FL_MEM](https://raw.githubusercontent.com/wangjwchn/BenchmarkImage/master/FL_MEM2.png)

> I think JWAnimatedImage is better than FLAnimatedImage in cpu and memory usage.

##Licence