Virtual Functions and Performance C++

后端 未结 8 573
梦毁少年i
梦毁少年i 2021-01-18 04:10

Before you cringe at the duplicate title, the other question wasn\'t suited to what I ask here (IMO). So.

I am really wanting to use virtual functions in my applicat

8条回答
  •  花落未央
    2021-01-18 04:25

    In my opinion, When there was less number of loops, may be there was no context switching, But when you increased the number of loops, then there are very strong chances that context switching takes place and that is dominating the reading. For example first program takes 1 sec and second program 3 secs, but if context switch takes 10 secs, then the difference is 13/11 instead of 3/1.

提交回复
热议问题