From: Vlad K. <hv...@us...> - 2009-04-24 12:31:16
|
All, Recall thread "Speed difference between 2.1.2 and 2.5.0 again" by Gabor Boros from April 8. Gabor kindly sent to me script which reproduced problem. I can confirm : SS 2.1.2 executed script by 25-27 sec while SS HEAD executed same script by 36-38 sec. The script contains mostly INSERTS's and i found that most time engine spend in dsql\prepare. Before v2.5 DSQL created own memory pool for every statement. When statement is released its pool is destroyed too. Sometime at v2.5 stage Dmitry made DSQL pool allocated from common database pool. It allows to somewhat reduce memory consumption. But this change make DSQL pool to redirect most of all small requests to the parent (database) pool. This is tens or even hundreds of small memory chunks. When DSQL pool is released it must deallocate all memory chunks allocated from parent pool and pass them to the parent pool one-by-one. This is very slow of course. I disabled "parent_redirect" feature of memory pools and HEAD executed script by 26-28 sec now. The question is - what should we do in HEAD with it ? I see two options : a) disable "parent_redirect". It will make HEAD work almost as 2.1, AFAIU b) rework "parent_redirect" to request medium sized memory chunks from parent pool (say 4-8KB) and use it to allocate memory for immediate callers. When such pool is freed it (pool) have to deallocate from parent pool much less number of memory blocks. Opinions ? Regards. Vlad |