This is a creation in Article, where the information may have evolved or changed.
First of all, why do I choose go? What has been done before is the development of the. NET platform, the common service-side language is C #. When I first approached C #, I liked the high-level language, which was elegant, easy to learn, short on development cycles, many advanced features and a self-hosted memory management GC ... It took nearly 3 years, and slowly felt its shortcomings (high memory consumption, system complexity, not lean enough, to the. NET framework of the strong lazy, unable to cross the platform, of course, now. NET core open source and cross-platform, performance also has a great improvement, just too many pits, The current use has not been popularized) and become intolerable. At the same time, a language called Go was getting more and more hot, so he looked at it. Said:
- Simple, fast and secure
- Parallel, fun, open source
- Memory management, v array security, fast compilation
Just solves a part of C # can't solve the problem, the most important or short, concise and fast. I tried to do a data service that was similar to the one I took over before work. This service involves common open source projects such as Message Queuing rabbitmq,nosql redis cache, MySQL database, and so on. It took almost 1 months of idle time from learning to completing a complete service. The operating environment of the program is Win7 64bit, the following direct display of the running memory situation of the comparison:
1.c# (Data Service)
Process situation:
2.go (Data Service)
The compiled Windows console:
Process situation:
As you can see, the run memory of the Go program is basically a fraction of C # programs. (129m-7m) Here only compares their memory operation, this is also I use it's a very important reason, of course, there are iops,cpu, and mq,redis communication efficiency and so on performance comparison, and so on after the time, followed by the display.
Interested in this project novice, can go to my git to see the source, has been open source. Shortcomings, but also welcome the great God to criticize you!
Https://gitee.com/zhaohu37/zhiot-go