GORM Playground Link

https://github.com/go-gorm/playground/pull/1

Description

Bulk create (200 records) is very slow due to logging. The pprof shows following result:

(pprof) top -cum
Showing nodes accounting for 370ms, 59.68% of 620ms total
Showing top 10 nodes out of 63
      flat  flat%   sum%        cum   cum%
         0     0%     0%      460ms 74.19%  gorm.io/gorm.(*DB).Create
         0     0%     0%      460ms 74.19%  gorm.io/gorm.(*processor).Execute
         0     0%     0%      460ms 74.19%  gormtest.TestBulkCreate
         0     0%     0%      460ms 74.19%  testing.tRunner
         0     0%     0%      450ms 72.58%  gorm.io/driver/postgres.Dialector.Explain
         0     0%     0%      450ms 72.58%  gorm.io/gorm.(*processor).Execute.func1
         0     0%     0%      450ms 72.58%  gorm.io/gorm/logger.ExplainSQL
         0     0%     0%      450ms 72.58%  gorm.io/gorm/logger.logger.Trace
         0     0%     0%      450ms 72.58%  strings.Replace
     370ms 59.68% 59.68%      370ms 59.68%  indexbody

The Replace in ExplainSQL took a long time for long string.

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking