Improve the allocation algorithm in PoolChunk
Improve the allocation algorithm in PoolChunk

Motivation:

Depth-first search is not always efficient for buddy allocation.

Modification:

Employ a new faster search algorithm with different memoryMap layout.

Result:

With thread-local cache disabled, we see a lot of performance
improvment, especially when the size of the allocation is as small as
the page size, which had the largest search space previously:

-- master head --
Benchmark                (size) Mode    Score  Error Units
pooledDirectAllocAndFree  8192 thrpt  215.392  1.565 ops/ms
pooledDirectAllocAndFree 16384 thrpt  594.625  2.154 ops/ms
pooledDirectAllocAndFree 65536 thrpt 1221.520 18.965 ops/ms
pooledHeapAllocAndFree    8192 thrpt  217.175  1.653 ops/ms
pooledHeapAllocAndFree   16384 thrpt  587.250 14.827 ops/ms
pooledHeapAllocAndFree   65536 thrpt 1217.023 44.963 ops/ms

-- changes --
Benchmark                (size) Mode    Score  Error Units
pooledDirectAllocAndFree  8192 thrpt 3656.744 94.093 ops/ms
pooledDirectAllocAndFree 16384 thrpt 4087.152 22.921 ops/ms
pooledDirectAllocAndFree 65536 thrpt 4058.814 29.276 ops/ms
pooledHeapAllocAndFree    8192 thrpt 3640.355 44.418 ops/ms
pooledHeapAllocAndFree   16384 thrpt 4030.206 24.365 ops/ms
pooledHeapAllocAndFree   65536 thrpt 4103.991 70.991 ops/ms

wuyinxian124/netty,wangyikai/netty,kvr000/netty,lugt/netty,mosoft521/netty,drowning/netty,xiongzheng/netty,exinguu/netty,carlbai/netty,duqiao/netty,BrunoColin/netty,mway08/netty,shism/netty,BrunoColin/netty,shism/netty,qingsong-xu/netty,mubarak/netty,shenguoquan/netty,serioussam/netty,jenskordowski/netty,brennangaunce/netty,Mounika-Chirukuri/netty,nmittler/netty,jdivy/netty,hyangtack/netty,chinayin/netty,sverkera/netty,chinayin/netty,seetharamireddy540/netty,qingsong-xu/netty,kvr000/netty,ajaysarda/netty,silvaran/netty,ninja-/netty,buchgr/netty,mcanthony/netty,CodingFabian/netty,tempbottle/netty,zhujingling/netty,sunbeansoft/netty,carlbai/netty,nayato/netty,olupotd/netty,wangyikai/netty,alkemist/netty,yawkat/netty,rovarga/netty,gigold/netty,hgl888/netty,lightsocks/netty,zxhfirefox/netty,Alwayswithme/netty,mway08/netty,ninja-/netty,firebase/netty,LuminateWireless/netty,sja/netty,sunbeansoft/netty,unei66/netty,AchinthaReemal/netty,eonezhang/netty,phlizik/netty,firebase/netty,danny200309/netty,nadeeshaan/netty,yonglehou/netty-1,blademainer/netty,orika/netty,jdivy/netty,qingsong-xu/netty,lznhust/netty,afds/netty,brennangaunce/netty,CodingFabian/netty,lightsocks/netty,normanmaurer/netty,nadeeshaan/netty,afredlyj/learn-netty,MediumOne/netty,woshilaiceshide/netty,x1957/netty,afds/netty,liuciuse/netty,woshilaiceshide/netty,zhujingling/netty,shenguoquan/netty,zhoffice/netty,bob329/netty,jovezhougang/netty,zxhfirefox/netty,x1957/netty,huuthang1993/netty,ioanbsu/netty,tempbottle/netty,tempbottle/netty,woshilaiceshide/netty,normanmaurer/netty,ninja-/netty,WangJunTYTL/netty,lznhust/netty,sammychen105/netty,lukehutch/netty,AchinthaReemal/netty,hepin1989/netty,Kalvar/netty,yonglehou/netty-1,f7753/netty,blademainer/netty,shelsonjava/netty,mosoft521/netty,ajaysarda/netty,youprofit/netty,nmittler/netty,nat2013/netty,lukw00/netty,chrisprobst/netty,liyang1025/netty,DolphinZhao/netty,caoyanwei/netty,nayato/netty,brennangaunce/netty,Alwayswithme/netty,clebertsuconic/netty,nkhuyu/netty,niuxinghua/netty,shuangqiuan/netty,carlbai/netty,WangJunTYTL/netty,xiexingguang/netty,sja/netty,fantayeneh/netty,xiongzheng/netty,fantayeneh/netty,f7753/netty,sunbeansoft/netty,wangyikai/netty,danbev/netty,hyangtack/netty,louiscryan/netty,clebertsuconic/netty,timboudreau/netty,lightsocks/netty,Mounika-Chirukuri/netty,castomer/netty,caoyanwei/netty,jdivy/netty,xiexingguang/netty,duqiao/netty,junjiemars/netty,dongjiaqiang/netty,bigheary/netty,wuyinxian124/netty,smayoorans/netty,ajaysarda/netty,eonezhang/netty,eincs/netty,zhoffice/netty,junjiemars/netty,lukehutch/netty,mcanthony/netty,orika/netty,buchgr/netty,zhoffice/netty,huanyi0723/netty,liyang1025/netty,orika/netty,mcanthony/netty,eincs/netty,fantayeneh/netty,djchen/netty,phlizik/netty,chrisprobst/netty,fantayeneh/netty,shism/netty,ninja-/netty,lukw00/netty,balaprasanna/netty,chinayin/netty,djchen/netty,ijuma/netty,castomer/netty,Kingson4Wu/netty,olupotd/netty,shuangqiuan/netty,sverkera/netty,timboudreau/netty,afds/netty,slandelle/netty,JungMinu/netty,pengzj/netty,danbev/netty,smayoorans/netty,ioanbsu/netty,shelsonjava/netty,orika/netty,liuciuse/netty,zhujingling/netty,MediumOne/netty,drowning/netty,shism/netty,niuxinghua/netty,exinguu/netty,tempbottle/netty,AchinthaReemal/netty,Kalvar/netty,shenguoquan/netty,BrunoColin/netty,IBYoung/netty,unei66/netty,youprofit/netty,AchinthaReemal/netty,sja/netty,xiongzheng/netty,liyang1025/netty,sunbeansoft/netty,mway08/netty,nkhuyu/netty,danbev/netty,caoyanwei/netty,jenskordowski/netty,rovarga/netty,x1957/netty,moyiguket/netty,kjniemi/netty,nkhuyu/netty,ajaysarda/netty,zxhfirefox/netty,clebertsuconic/netty,normanmaurer/netty,ajaysarda/netty,lznhust/netty,blademainer/netty,blademainer/netty,hgl888/netty,jovezhougang/netty,altihou/netty,mosoft521/netty,chinayin/netty,junjiemars/netty,yawkat/netty,slandelle/netty,liuciuse/netty,zzcclp/netty,ijuma/netty,sverkera/netty,Mounika-Chirukuri/netty,IBYoung/netty,huanyi0723/netty,lugt/netty,qingsong-xu/netty,huanyi0723/netty,hyangtack/netty,codevelop/netty,seetharamireddy540/netty,rovarga/netty,firebase/netty,serioussam/netty,rovarga/netty,DolphinZhao/netty,yawkat/netty,liuciuse/netty,zxhfirefox/netty,louiscryan/netty,pengzj/netty,yonglehou/netty-1,CodingFabian/netty,balaprasanna/netty,ijuma/netty,lugt/netty,zhoffice/netty,yawkat/netty,f7753/netty,bob329/netty,jdivy/netty,duqiao/netty,djchen/netty,ioanbsu/netty,wuyinxian124/netty,nmittler/netty,duqiao/netty,balaprasanna/netty,zhujingling/netty,xingguang2013/netty,nayato/netty,LuminateWireless/netty,jovezhougang/netty,jdivy/netty,Alwayswithme/netty,brennangaunce/netty,eonezhang/netty,WangJunTYTL/netty,shelsonjava/netty,moyiguket/netty,eonezhang/netty,tempbottle/netty,JungMinu/netty,pengzj/netty,mubarak/netty,clebertsuconic/netty,Kingson4Wu/netty,satishsaley/netty,codevelop/netty,xiongzheng/netty,WangJunTYTL/netty,sunbeansoft/netty,caoyanwei/netty,caoyanwei/netty,Kalvar/netty,danny200309/netty,eincs/netty,normanmaurer/netty,JungMinu/netty,sameira/netty,bigheary/netty,danny200309/netty,danny200309/netty,huuthang1993/netty,WangJunTYTL/netty,timboudreau/netty,moyiguket/netty,sameira/netty,nadeeshaan/netty,nadeeshaan/netty,xingguang2013/netty,jenskordowski/netty,AnselQiao/netty,gigold/netty,satishsaley/netty,timboudreau/netty,ijuma/netty,LuminateWireless/netty,castomer/netty,jenskordowski/netty,dongjiaqiang/netty,wuxiaowei907/netty,niuxinghua/netty,bigheary/netty,afredlyj/learn-netty,bigheary/netty,xingguang2013/netty,f7753/netty,lznhust/netty,jenskordowski/netty,kvr000/netty,altihou/netty,shuangqiuan/netty,dongjiaqiang/netty,nkhuyu/netty,afds/netty,wuxiaowei907/netty,xingguang2013/netty,lukw00/netty,smayoorans/netty,DolphinZhao/netty,satishsaley/netty,sammychen105/netty,drowning/netty,lugt/netty,zzcclp/netty,zhoffice/netty,mosoft521/netty,lukehutch/netty,kjniemi/netty,zhujingling/netty,sameira/netty,hepin1989/netty,mway08/netty,wuxiaowei907/netty,BrunoColin/netty,wuyinxian124/netty,satishsaley/netty,gigold/netty,altihou/netty,timboudreau/netty,altihou/netty,olupotd/netty,shism/netty,shelsonjava/netty,x1957/netty,youprofit/netty,zzcclp/netty,mway08/netty,exinguu/netty,IBYoung/netty,Mounika-Chirukuri/netty,MediumOne/netty,youprofit/netty,kvr000/netty,codevelop/netty,dongjiaqiang/netty,sameira/netty,wangyikai/netty,xiexingguang/netty,louiscryan/netty,gigold/netty,kvr000/netty,lugt/netty,yonglehou/netty-1,duqiao/netty,yawkat/netty,liuciuse/netty,eincs/netty,xiexingguang/netty,serioussam/netty,CodingFabian/netty,Alwayswithme/netty,jovezhougang/netty,MediumOne/netty,Alwayswithme/netty,mcanthony/netty,sja/netty,sammychen105/netty,huuthang1993/netty,niuxinghua/netty,DolphinZhao/netty,lznhust/netty,nat2013/netty,nayato/netty,kjniemi/netty,JungMinu/netty,moyiguket/netty,lukw00/netty,chrisprobst/netty,xingguang2013/netty,phlizik/netty,olupotd/netty,afredlyj/learn-netty,smayoorans/netty,louiscryan/netty,Kingson4Wu/netty,altihou/netty,AnselQiao/netty,shenguoquan/netty,alkemist/netty,castomer/netty,brennangaunce/netty,danbev/netty,normanmaurer/netty,seetharamireddy540/netty,carlbai/netty,serioussam/netty,seetharamireddy540/netty,woshilaiceshide/netty,IBYoung/netty,Kalvar/netty,MediumOne/netty,kjniemi/netty,Kingson4Wu/netty,pengzj/netty,wuxiaowei907/netty,mubarak/netty,AnselQiao/netty,mosoft521/netty,hepin1989/netty,alkemist/netty,LuminateWireless/netty,x1957/netty,AnselQiao/netty,shuangqiuan/netty,jovezhougang/netty,afds/netty,qingsong-xu/netty,balaprasanna/netty,clebertsuconic/netty,nadeeshaan/netty,hgl888/netty,junjiemars/netty,firebase/netty,dongjiaqiang/netty,satishsaley/netty,chrisprobst/netty,Kalvar/netty,sameira/netty,bob329/netty,CodingFabian/netty,kjniemi/netty,mcanthony/netty,chinayin/netty,danbev/netty,mubarak/netty,eincs/netty,xiongzheng/netty,sja/netty,drowning/netty,woshilaiceshide/netty,junjiemars/netty,phlizik/netty,lukw00/netty,olupotd/netty,xiexingguang/netty,buchgr/netty,eonezhang/netty,exinguu/netty,balaprasanna/netty,IBYoung/netty,codevelop/netty,chrisprobst/netty,bob329/netty,silvaran/netty,ioanbsu/netty,f7753/netty,zzcclp/netty,liyang1025/netty,yonglehou/netty-1,hyangtack/netty,fantayeneh/netty,nayato/netty,youprofit/netty,sverkera/netty,ninja-/netty,hepin1989/netty,liyang1025/netty,serioussam/netty,Mounika-Chirukuri/netty,blademainer/netty,exinguu/netty,shuangqiuan/netty,buchgr/netty,Kingson4Wu/netty,unei66/netty,lightsocks/netty,lightsocks/netty,zxhfirefox/netty,shelsonjava/netty,silvaran/netty,louiscryan/netty,nat2013/netty,lukehutch/netty,sverkera/netty,mubarak/netty,bigheary/netty,lukehutch/netty,djchen/netty,bob329/netty,huuthang1993/netty,wangyikai/netty,huuthang1993/netty,AnselQiao/netty,BrunoColin/netty,smayoorans/netty,huanyi0723/netty,DolphinZhao/netty,unei66/netty,slandelle/netty,AchinthaReemal/netty,danny200309/netty,alkemist/netty,hgl888/netty,ioanbsu/netty,wuxiaowei907/netty,hgl888/netty,castomer/netty,niuxinghua/netty,LuminateWireless/netty,slandelle/netty,huanyi0723/netty,unei66/netty,zzcclp/netty,ijuma/netty,alkemist/netty,shenguoquan/netty,silvaran/netty,moyiguket/netty,nkhuyu/netty,carlbai/netty,seetharamireddy540/netty,orika/netty,gigold/netty,silvaran/netty,djchen/netty