Performance Optimization: reduce slice2Bean calling times of strings.ToLower and map creation times #2255

Merged
lunny merged 2 commits from ankisme/xorm:optimize-slice2Bean into master 2023-07-12 09:53:23 +00:00
Contributor
  1. 优化性能:减少func (session *Session) slice2Bean方法中的strings.ToLower调用次数以及减少map创建和访问次数(见工单 #2243

  2. 新增SetDefaultJSONHandler方法,用于用户自行设置DefaultJSONHandler(见工单 #2129

优化前:
加载耗时=16.079s,总记录数=4028940
加载耗时=15.775s,总记录数=4028940
加载耗时=15.946s,总记录数=4028940

优化后:
加载耗时=10.863s,总记录数=4028940
加载耗时=11.257s,总记录数=4028940
加载耗时=11.155s,总记录数=4028940

1. 优化性能:减少func (session *Session) slice2Bean方法中的strings.ToLower调用次数以及减少map创建和访问次数(见工单 https://gitea.com/xorm/xorm/issues/2243) 2. 新增SetDefaultJSONHandler方法,用于用户自行设置DefaultJSONHandler(见工单 https://gitea.com/xorm/xorm/issues/2129) 优化前: 加载耗时=16.079s,总记录数=4028940 加载耗时=15.775s,总记录数=4028940 加载耗时=15.946s,总记录数=4028940 优化后: 加载耗时=10.863s,总记录数=4028940 加载耗时=11.257s,总记录数=4028940 加载耗时=11.155s,总记录数=4028940
ankisme added 1 commit 2023-04-19 10:01:49 +00:00
2. 新增SetDefaultJSONHandler方法,用于用户自行设置DefaultJSONHandler(见工单 #2129
lunny added 1 commit 2023-07-12 08:10:11 +00:00
Merge branch 'master' into optimize-slice2Bean
All checks were successful
test mariadb / test mariadb (pull_request) Successful in 5m26s
test cockroach / test cockroach (pull_request) Successful in 7m59s
test mysql / test mysql (pull_request) Successful in 5m42s
test mssql / test mssql (pull_request) Successful in 6m41s
test mysql8 / test mysql8 (pull_request) Successful in 5m47s
test postgres / test postgres (pull_request) Successful in 6m25s
test tidb / test tidb (pull_request) Successful in 6m7s
test sqlite / unit test & test sqlite (pull_request) Successful in 9m18s
40a3e27af2
lunny changed title from 优化性能:减少func (session *Session) slice2Bean方法中的strings.ToLower调用次数以及减少map创建和访问次数 to Performance Optimization: reduce slice2Bean calling times of strings.ToLower and map creation times 2023-07-12 09:53:13 +00:00
lunny merged commit 73eee961cc into master 2023-07-12 09:53:23 +00:00
lunny added this to the 1.3.3 milestone 2023-07-26 01:30:29 +00:00
Sign in to join this conversation.
No description provided.