go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

Why don't you just use func for logic in existing frameworks?

Open Luoxin opened this issue 1 month ago • 2 comments

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.

Luoxin avatar May 13 '24 11:05 Luoxin