![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| ||||
| ||||
|
|
OK. I will provide a patch soon. I will try to provide something that=20 has a global default and can be changed at the session level. |
|
The current compression code allocates two buffers using free/malloc=20 that are each about as large as the uncompressed packet each time a=20 packet must be written to the network. I had another change that reduced=20 that to one call to malloc and free. That change did not have much of an=20 effect on performance, but I did not run any multi-threaded tests where=20 calls to malloc and free might be more expensive. I don't know how good=20 glibc malloc is for threaded apps. I do know that other mallocs are not=20 so good (Sun has published a paper on the benefits of mtmalloc for MySql)= .. |
|
From my limited understanding of MySql source, it tries to reduce the=20 number of calls to free and malloc, but the implementation of network=20 compression might be one case where that is not true. |
|
Is it worth my time to try to prepare a patch that either reduces the=20 calls to malloc and free to one per flush of a packet to the network=20 rather than two calls as is currently done? The calls could be further=20 reduced by caching the allocated buffer as part of the thread context so=20 that it is only allocated once. |
![]() |
| Thread Tools | |
| Display Modes | |
| |