60

Плюсы и минусы Go для разработчиков на C++, Вячеслав Бахмутов

  • Upload
    yandex

  • View
    162

  • Download
    2

Embed Size (px)

DESCRIPTION

В докладе речь пойдёт о языке Go. Вячеслав расскажет о внутреннем устройстве языка (структуре, оптимизации, сборщике мусора и т.д.), о том, как и почему Go используют в Яндексе и что о нём говорят разработчики на С++. Отдельно Вячеслав остановится на многопоточном программировании и особенностях отладки и профилирования в Go.

Citation preview

  • 1. Go C++ - C++ party , 26.09.2014
  • 2. 1. 1. Go 2. 3. , 2. A. B. escape analysis C. Go D. E. 3
  • 3. 4 1. Go 2. 3. ,
  • 4. Go. . Google 2007 2009 2012 go 1.0 2014 go 1.3. : Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Plan 9 Microsoft Windows. : i386, amd64 ARM 2015 go 1.4 Android?* 5 * http://bit.ly/go-android
  • 5. Go. . 6 https://www.openhub.net/languages/compare
  • 6. Go. . 7 https://www.openhub.net/languages/compare
  • 7. Go. . 8 Gogs Github , Go
  • 8. Go. . 9 Golang Russian
  • 9. Go. . 10
  • 10. . . 1. . 2. , . 3. 4. - Go . 5. , , , pointer arithmetic. 6. , . 7. ( [], , , , , ..) 8. ( Google) 11
  • 11. . 12 Python C++ ~500 RPS >5000 RPS
  • 12. - - - =( 13 ++ Python - - - - -
  • 13. . 14
  • 14. Go Cocaine. * HttpHandler Cocaine 15 * http://bit.ly/cocaine-go
  • 15. . . 16 Go , , Go
  • 16. . . 17 : go test -bench go test -bench -cpu=1,2,4 go test -benchmem go test -cpuprofile go test -memprofile go test -blockprofile
  • 17. . . 18 +
  • 18. . 19 BDD, TDD
  • 19. . . 20 GC
  • 20. . . 21
  • 21. . . 22
  • 22. . Races. 23
  • 23. . . 24 Python C++
  • 24. . . 25 ++ http Elliptics
  • 25. . . 26 Go 1.3 GC off http Elliptics
  • 26. . . 27 Go 1.3 GC on http Elliptics
  • 27. . . 28 http (~1000rps)
  • 28. . . . 29 Generics - Go
  • 29. . . ++ - GC range, len, cap, make builtin . defer. . . ! 30
  • 30. . . , . , . HTTP , . - . " " - . go get low-level crypto api 31
  • 31. . . 32 2 C++ 8-15 python* ~30 python* 70 % *
  • 32. 33 A. B. escape analysis C. Go D. E.
  • 33. . 34 Go - 4 Python - 24 Java - 4 Java - 16/24 (32/64)
  • 34. . 35
  • 35. 1. . 2. , - . 3. 36
  • 36. . Inlining 1. . 2. . ( ). 3. . 4. 5. , . 6. . 37
  • 37. . Inlining 38 :
  • 38. Escape analysis 1.Go , 2., . 3. , 4. . 5. ! 39
  • 39. Escape analysis. 1 40 1. numbers 2. 3.
  • 40. Escape analysis. 2 41 1. Center CenterCursor 2.Cursor
  • 41. Escape analysis. 42
  • 42. Go . . 1. 2. . 3. 4. N:M 43
  • 43. Go . 1. 2. Go 3. , 4. 4 ( ) 5. . 44
  • 44. Go . 1. 2. 3. 4. ( ) 5.netpoller (epoll, kqueue ..) 6. runtime.gosched 7. 45
  • 45. Go . 46
  • 46. Go . . 47
  • 47. Go . . 48 M - P - () G - Go
  • 48. Go . . 49
  • 49. Go . . 50 M1
  • 50. Go . . 51 Go
  • 51. Go . . 52 1. Go , 2.Go 3. P 4. ( )
  • 52. 53
  • 53. Go 54 1. guard pages 2. (4) 3.
  • 54. Go 55
  • 55. Go 56 Hot-split problem
  • 56. Go 57
  • 57. Garbage collector. 1. STW/CGC, tricolor mark and sweep 2.Quality of Service 10/50 ms 3. 4. ! 58
  • 58. 1.Analysis of the Go runtime scheduler (Columbia University) 2.Morsings Blog 3.The Go Programming Language Blog 4.Dmitry Vyukov (blog, answers and proposals) 5.Dave Chaney 6.Golang groups: nuts and devs and russian 59
  • 59. 60 twitter: @m0sth8 email: [email protected] : http://bit.ly/go-doklad2