node-mysql2: node-mysql2 is running slower than node-mysql, config issue?
Hi, I wanted to try mysql2
as a replacement for mysql
for performance reasons. When I tried it in a production environment, I am actually seeing that mysql2
is slower, so I wonder if it’s a config issue on my end. Are there any settings I should try changing?
Using the profiler, I didn’t see anything out of the ordinary. The vast majority of time is spent in handlePacket -> TextRow -> wrap. The only other difference I notice between the two libraries is that mysql2
seems to invoke Readable.push
in a very regular frequency time-wise, whereas mysql
does it in an irregular pattern. Thank you!
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 26 (26 by maintainers)
I generated it using https://www.mockaroo.com/
I found a couple issues with it. It seems to be much slower due to
For the first one, I can fix it by caching column definition attribute.