# gls **Repository Path**: mirrors/gls ## Basic Information - **Project Name**: gls - **Description**: golang 语言目前唯一的高性能 goroutine local storage 实现,每秒可以完成数百万次Get/Set。 Operate Performance Benchmark_Goid 5.30 ns/op Benchmark_Set 271 ns/op Benchmark_Get 155 ns/op Benchmark_Set_4Threads 129 ns/op Benchmark_Get_4Threads 58.6 ns/op   使用起来极为简单: import "github.com/yyzybb537/gls" // 设置协程局部变量 gls.Set("Value", 1) // 获取协程局部变量 var i int = gls.Get("Value").(int) // 协程退出时使用Cleanup清除相关资源 defer Cleanup()   - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: https://www.oschina.net/p/gls - **GVP Project**: No ## Statistics - **Stars**: 9 - **Forks**: 0 - **Created**: 2017-06-29 - **Last Updated**: 2026-01-24 ## Categories & Tags **Categories**: utils **Tags**: None ## README # gls Goroutine local storage library # Benchmark | Operate | Performance | | ------| ------ | | Benchmark_Goid | 5.30 ns/op | | Benchmark_Set | 271 ns/op | | Benchmark_Get | 155 ns/op | | Benchmark_Set_4Threads | 129 ns/op | | Benchmark_Get_4Threads | 58.6 ns/op |