Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost MultiIndexContainer, how to do delayed indexing for fast insertion?
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2015-02-17 16:20:24


HuMichael <hujinying <at> hotmail.com> writes:

>
> I used below MultiIndexContainer
>
> typedef multi_index_container<PositionSummary*,
> indexed_by<
> ordered_unique<composite_key<...> >,
> ordered_unique<composite_key<...> >
> > PositionSummaryContainer;
>
> And I inserted 10000 insts*36 accounts*100 days=36 million records
> [...]
> for (int i = 0; i < numOfDays_; i++)
> {
> for (int j = 0; j < accountSize_; j++)
> {
> for (int k = 0; k < instSize_; k++)
> {
> PositionSummary* ps =
> psArray_[(i * accountSize_ + j) * instSize_ + k];
> uniqueIndex.insert(ps);
> }
> }
> }
> [...]
> And I found the speed of insertion is a little bit slow, about 20K+
> records per second... Is there anyway to enhance¡¥Ì¥¹Í•ÉÑ¥½¸ÍÁ••ü(ø5䁑…Ñ„Ý…́¥¸=É…±”°ÁɽÁ•É±ä¥¹‘•á•°Í¼Ñ¡•É”Í¡½Õ±‰”¹¼‘…¹•È(ø½˜½ÉÉÕÁÑ•‘…Ñ„ÍÑÉՍÑÕÉ”¸()]•±°°Í•Ù•É…°¥‘•…́å½Ô…¸Ñ•ÍÐè((¨%˜Ñ¡”‘…Ñ„¥Ì‰•¥¹œÁ½ÁÕ±…Ñ•¥¸…¸½É‘•È½¹Í¥ÍÑ•¹ÐÝ¥Ñ •¥Ñ¡•È)¥¹‘•à°¡¥¹Ñ•¥¹Í•ÉÑ¥½¸µ¥¡Ð•Ðå½ÔÍ½µ”ÍÁ••‘ÕÀè((€Õ¹¥ÅÕ•%¹‘•à¹¥¹Í•ÉСչ¥ÅÕ•%¹‘•à¹•¹ ¤±Á̤ì()e½Ôµ¥¡Ð¹••Ñ¼Á±…äÝ¥Ñ Ñ¡”¤±¨±¬±½½À½É‘•ÈÑ¼¡¥ÐÑ¡¥ÌÉ¥¡Ð¸((¨%˜å½ÕȁÅÕ•É¥•Ì½¸Ñ¡”½µÁ½Í¥Ñ”­•ǻ…É”¹•Ù•ÈÁ…ÉÑ¥…°€¡¤¹”¸å½Ô)…±Ý…ǻÍÁ•¥™äÑ¡•¥ÈÑ¡É•”Á…É…µ•Ñ•É̤°Íݥэ¡¥¹œÑ¼¡…Í¡•‘}Õ¹¥ÅÕ”)ݽ¸Ð‰É•…¬å½Õȁ½‘”…¹Ý¥±°±¥­•±äÉ•ÍձЁ¥¸™…Íѕȁ•á•ÕÑ¥½¸)‰½Ñ …Ё¥¹Í•ÉÑ¥½¸…¹±½½­ÕÀÑ¥µ•Ì¸((¨ …¸å½ÔÍѽɔA½Í¥Ñ¥½¹MÕµµ…ÉäÌÉ…Ñ¡•ÈÑ¡…¸A½Í¥Ñ¥½¹MÕµµ…É䀨ÌüQ¡¥Ì)•±¥µ¥¹…ѕ́½¹”Á½¥¹Ñ•È¥¹‘¥É•Ñ¥½¸°µ½‘•Íѱ䁥µÁɽٕ́±½…±¥ÑWF2à ¢¢6â–÷RW6RÆ–v‡FW"G—W2F†â7FC£§7G&–æw2f÷"66÷VçF–BæB–ç7F–@¢†Æ–¶R–çG2“ð ¤…D€ ¤¦ö\:ÖâÒÌ;7W¢×\;÷ ¥FVÆVl;6æ–6


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net