sunfmin / notebook

My Note Book
2 stars 0 forks source link

Set Micro client PoolSize and cache.Selector to increase call speed #9

Open sunfmin opened 8 years ago

sunfmin commented 8 years ago
    serv := micro.NewService(
        micro.Name("myou.srv.categories"),
        micro.Client(client.NewClient(
            client.PoolSize(10),
            client.Selector(cache.NewSelector()),
        )),
    )
    cli := serv.Client()

For an empty remote method call, it's half a ms:

BenchmarkCategoryDelete-8       3000        529876 ns/op
ok      github.com/sunfmin/myou/categories/tests    1.654s