|
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ÆvFW"GW2Fâ7FC£§7G&æw2f÷"66÷VçFBæ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