go-zero
go-zero copied to clipboard
Why don't you just use func for logic in existing frameworks?
The default code generation generates a NewXXXLogic
inside the handler, which then calls the relevant methods. Why not just generate a func to call it instead of creating a new object. In highly concurrent scenarios, the creation of such a new object without adding sync.pool is likely to result in additional memory requests and destruction, which would not occur if the func was used directly.