-
Notifications
You must be signed in to change notification settings - Fork 85
replace go-sql-connector/mysql with siddontang/go-mysql/client to improve dumpling's performance #126
Comments
append some information which maybe helpful:
|
/ping |
pong! I am challenge bot. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
/assign @kennytm |
/pick-up |
The challenge program issue is already in the assign flow, so you cannot pick up this issue. But the current issue needs help, you can contact @kennytm to try to solve this issue together. |
/pick-up |
Pick up success. |
@sylzd You did not submit PR within 7 days, so give up automatically. |
/pick-up |
Pick up success. |
@sylzd You did not submit PR within 7 days, so give up automatically. |
/pick-up |
Pick up success. |
@sylzd You did not submit PR within 7 days, so give up automatically. |
@sylzd hello, there hasn't been much updates since the pick up, do you need some help? |
@kennytm yes, replace driver may not help,it cost double. we are trying to replace database/sql or something else.
|
Do you replace |
/pick-up |
Pick up success. |
Description
Background
Currently dumpling's performance is only 1/2 to 2/3 of mydumper. There are two parts that cost a lot of time for dumpling.
That's because
driver.Value
indatabase/sql
package is aninterface{}
type variable.When we convert
[]byte
type varible tointerface{}
type, it will useruntime.mallocgc
inruntime.convTslice
to do that which will cost a lot of time, but we can't changedriver.Value
.One solution is to abandon the usage of
database/sql
and directly use the[]byte
value readed from mysql server. But this is a huge change for dumpling.read a row -> escape string -> write to buffer -> read next row ...
Actually, when we escape the value, we can start to read another row to improve the performance. But it seems hard for
database/sql
package to implement this function, which means we may have to implement the MySQL client by ourselves.Reference
[]byte
tointerface{}
assign
[]byte
tointerface{}
will cost much more time than assign to[]byte
in this test.https://gist.github.com/lichunzhu/2433d332b4bfc57fb7c1aa3f404b4c58
Revelant torch:
Tasks
Score
Mentor
Recommended Skills
The text was updated successfully, but these errors were encountered: