• The preface

    • About the book
  • Chapter one performance analysis

    • Benchmark Test
    • PPROF performance analysis
  • Chapter two commonly used data structures

    • Performance and principle of string concatenation
    • Slice performance and traps
    • Performance comparison between for and range
    • Reflect performance
  • Chapter 3 Concurrent Programming

    • Performance comparison between read-write locks and mutexes
    • How to exit a coroutine (timeout scenario)
  • Chapter 4 Compiler Optimization

    • Reduce compilation size
  • Appendix GO language traps

    • Arrays and Slices

The origin of this series

I’ve been using Go as my primary programming language for over a year now, mainly working on productivity tools such as distributed compilation accelerators. Where performance is not very sensitive, Python is usually used because Python has incomparable advantages in text processing, and where performance is particularly sensitive, Go is used. What I admire most about the Go language is its concurrency, coroutine plus channel, sync plus select, and I find it hard to find another language that makes concurrency as easy as Go.

To gain a better understanding of Go, I tried to learn about some well-known open source projects, such as GroupCache, a distributed cache. There was a question on Zhihu, “What are the Go open source projects worth learning?” Groupache is mentioned no less than three times below this answer. GroupCache is a refined, powerful version of the Swiss Army knife of caching. A good program is certainly highly regarded, and I think it is the quickest way to master a language to learn from the essence of these excellent programs. So, I created a project called 7Days-Golang, which used Go to emulate an open source project for seven days, hoping to emulate the best parts of the open source project in less than 1,000 lines of code. This project also benefited me a lot. Some programming methods and ideas I learned in this process also made my work more interesting. Some elegant designs and implementations have minimal code and are extremely efficient. Consistent hashes, single flights, etc.

Through learning some famous open source projects and GO source code, I also mastered a lot of programming skills and knew how to write to get better performance. These tips are piecemeal, and I’ve been hoping to organize them systematically, refine them, and eventually form a guide to high performance programming. Therefore, I started the high-performance programming project of GO language. This project has just started and is in a process of gradual improvement. We are working together with all of you.

Who is this book for?

If you are a beginner of Go, it is recommended that you read a concise tutorial on the Go language to learn the basic syntax of Go. This book is for those who have been using Go as their primary programming language for some time and want to improve their Go programming skills further.

Recommendations and References

  • Go language written test interview questions summary
  • Seven days using Go to implement the series from zero

The original address: Go | high-performance programming language geek rabbit rabbit project address: high – performance – Go on zhihu: geek rabbit rabbit