session_find.go noCacheFind性能问题 #2042

Open
opened 2021-09-06 11:08:04 +00:00 by Mr1X · 3 comments

engine.Find()方法
调试发现

耗时函数
func (session *Session) noCacheFind(table *core.Table, containerValue reflect.Value, sqlStr string, args ...interface{}) error {}

for rows.Next() {} 耗时几秒以上

结果集4511条数据,大小 1.55MB

反射结果集的时候存在性能问题

engine.Find()方法 调试发现 耗时函数 func (session *Session) noCacheFind(table *core.Table, containerValue reflect.Value, sqlStr string, args ...interface{}) error {} for rows.Next() {} 耗时几秒以上 结果集4511条数据,大小 1.55MB 反射结果集的时候存在性能问题
Owner

How many records do you fetch? And please upgrade your xorm version.

How many records do you fetch? And please upgrade your xorm version.
lunny added the
need
feedback
label 2021-09-07 01:22:38 +00:00
Author

How many records do you fetch? And please upgrade your xorm version.

table total record: 94476
select result record: 4511
result size: 1.5MB

I tried it yesterday on xorm.io/xorm v1.2.3
it also slow, and I checked that the key source code is the same

func (session *Session) noCacheFind

I'm sure there's a performance problem here for rows.Next() {}
Please see the logfile and search TODO and other Important logs like 111111, 222222, 33333

> How many records do you fetch? And please upgrade your xorm version. table total record: 94476 select result record: 4511 result size: 1.5MB I tried it yesterday on `xorm.io/xorm v1.2.3` it also slow, and I checked that the key source code is the same > func (session *Session) noCacheFind I'm sure there's a performance problem here `for rows.Next() {}` Please see the logfile and search `TODO` and other Important logs like `111111`, `222222`, `33333`
Owner

rows.Next is a simple wrap of database/sql, So I think if there is a performance problem. It's upstream related.

`rows.Next` is a simple wrap of `database/sql`, So I think if there is a performance problem. It's upstream related.
lunny added the
upstream
label 2021-09-17 10:52:36 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#2042
No description provided.