parser icon indicating copy to clipboard operation
parser copied to clipboard

Optimize parser performance

Open xingyong opened this issue 3 years ago • 1 comments

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error. financeaccount.zip in the attachment,use the go tool pprof profile,will see parser.New() is too hot because of slice allocation. image Maybe, a object pool is proper.

  2. What did you expect to see? Reduce the overhead of make slice

  3. What did you see instead? parser.New() is too hot

  4. What version of TiDB SQL Parser are you using? master, all versions

xingyong avatar Apr 26 '22 06:04 xingyong

The parser instance is expected to be reused.

tangenta avatar Apr 28 '22 07:04 tangenta