From f24b6ad0d096680b356cca88e7dca44b8b34ac09 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 4 Jan 2016 22:29:50 +0800 Subject: [PATCH 1/4] add my info --- README_gc.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README_gc.md b/README_gc.md index c0aadb7..ab69b03 100644 --- a/README_gc.md +++ b/README_gc.md @@ -19,6 +19,7 @@ - [@leisore](https://github.com/leisore) - [@dake](https://github.com/dake) - [@glight2000](https://github.com/glight2000) +- [@songleo](https://github.com/songleo) ## 适用人群 From 9d5f9bf68a9e730fd63937f717bce58751bf3935 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 4 Jan 2016 22:29:57 +0800 Subject: [PATCH 2/4] add my info --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3722639..8b3df0d 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ - [@leisore](https://github.com/leisore) - [@dake](https://github.com/dake) - [@glight2000](https://github.com/glight2000) + - [@songleo](https://github.com/songleo) ## 授权许可 From bb8f9c76bf40134bfdba8ac8ea0d88b8c35eecbe Mon Sep 17 00:00:00 2001 From: songleo Date: Mon, 4 Jan 2016 22:55:29 +0800 Subject: [PATCH 3/4] review chapter 18 --- eBook/18.1.md | 4 +++- eBook/18.8.md | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/eBook/18.1.md b/eBook/18.1.md index 2e79f59..b6c467d 100644 --- a/eBook/18.1.md +++ b/eBook/18.1.md @@ -32,7 +32,9 @@ for ix, ch := range str { 如何获取一个字符串的字符数: - 最快速:`utf8.RuneCountInString(str)` + 最快速:`utf8.RuneCountInString(str)` + + `len([]int(str))` (5)如何连接字符串: diff --git a/eBook/18.8.md b/eBook/18.8.md index 7e9f0b6..8dc4964 100644 --- a/eBook/18.8.md +++ b/eBook/18.8.md @@ -2,11 +2,11 @@ 出于性能考虑的建议: -实践经验表明,如果你使用并行计算获得高于串行运算的效率:在协程内部已经完成的大部分工作,其开销比创建协程和协程间通信还高。 +实践经验表明,如果你使用并行运算获得高于串行运算的效率:在协程内部已经完成的大部分工作,其开销比创建协程和协程间通信还高。 1 出于性能考虑建议使用带缓存的通道: -使用带缓存的通道可以很轻易成倍提高它的吞吐量,某些场景其性能可以提高至10倍甚至更多。通过调整通道的容量,你可以尝试着更进一步的优化其性能。 +使用带缓存的通道可以很轻易成倍提高它的吞吐量,某些场景其性能可以提高至10倍甚至更多。通过调整通道的容量,甚至可以尝试着更进一步的优化其性能。 2 限制一个通道的数据数量并将它们封装成一个数组: From 720e1f95bbc598c550cc3d2d7363d15d890e5e93 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 5 Jan 2016 21:24:32 +0800 Subject: [PATCH 4/4] Update 18.11.md --- eBook/18.11.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eBook/18.11.md b/eBook/18.11.md index b102272..f35d6c6 100644 --- a/eBook/18.11.md +++ b/eBook/18.11.md @@ -8,7 +8,7 @@ (4)尽可能的使用数组和切片代替映射(详见参考文献15); -(5)如果只想获取切片中某项值,不需要值的索引,尽可能的使用`for range`去遍历切片,这比必须去查询切片中的每个元素要快一些; +(5)如果只想获取切片中某项值,不需要值的索引,尽可能的使用`for range`去遍历切片,这比必须查询切片中的每个元素要快一些; (6)当数组元素是稀疏的(例如有很多`0`值或者空值`nil`),使用映射会降低内存消耗; @@ -27,4 +27,4 @@ - [目录](directory.md) - 上一节:[其他](18.10.md) -- 下一章:[构建一个完整的应用程序](19.0.md) \ No newline at end of file +- 下一章:[构建一个完整的应用程序](19.0.md)