Golang
-
Memory usage can be retrieved using
runtime.ReadMemStats()
(Sample Gist) -
Avoid moving data to the heap for a performance improvement. When assigning variables, if you can work with the reference to your data rather than copying it out, that reduces heap usage.
Compile your code with the
-gcflags=-m
look for occurrences ofmoved to heap
. See if you can avoid that. (source, HN)
Learning Resourcesโ
- Effective Go
- Hasnโt been updated since 2009, but the core concepts still remain. Does not
account for things like
go mod
or any of the new language features.
- Hasnโt been updated since 2009, but the core concepts still remain. Does not
account for things like
- Learn Go with Tests
- Building a BitTorrent client from the ground up in Go, Jesse Li (HN)
- The Busy Developerโs Guide to Go Profiling, Tracing, and Observability by DataDog
Useful Frameworksโ
Useful Librariesโ
- cobra: CLI apps made easy
- ent: Entity framework for Go
- gin: HTTP library
- migrate: Database migrations
- viper: App configuration via files and flags
- By Charm:
Database Librariesโ
- DB2:
- MSSQL:
- denisenkom/go-mssqldb
- microsoft/go-mssqldb: Microsoft fork of the original project made by denisenkom