Re: nsGenericElement::InsertBefore performance

Andreas Pflug <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
Seems I have some trouble replying, please apologize for possible 
duplicates.

Boris Zbarsky wrote:
>> So I downloaded the code, had it build and applied some profiling
>> code to selected lines of code. I can see
>> nsGenericElement::InsertBefore consuming 6-7ms (compiled for
>> debugging) on each call. I found that 
>> nsCSFrameConstructor::ContentAppended as called from 
>> nsGenericElement::doInsertChildAt will take half of the time (with
>>  many time consuming calls nsNodeUtils::CloneAndAdopt, and the
>> final mozAutoDocUpdate destructor calling nsDocument::EndUpdate the
>> other half.
> 
> I can't say much without seeing either your actual profile data or
> your testcase (or ideally both), but here are the things that need to
> happen under ContentAppended:

The testcase is sunbird CVS (VC2008), one calendar, one visible event in
month view. Toggle the calendar off and on.

Regards,
Andreas

The profiling result:

"position"	"finish"	"ticks"	"location"	"duration (us)"
1	1	301170324	"100 milliseconds"	99990
2	3	142	"Single pseProfiler"	0
3	3	32	"nothing"	0
10644	10720	19461357	"nsGenericElement::InsertBefore"	6461
10645	10713	9732043	"nsCSSFrameConstructor::ContentAppended"	3231
10646	10713	8749647	"nsCSSFrameConstructor::ConstructFrame"	2905
10647	10670	1283821	"nsXBLService::LoadBindings"	426
10648	10670	549246	"nsNodeUtils::CloneAndAdopt"	182
10649	10670	517557	"nsNodeUtils::CloneAndAdopt"	172
10650	10666	394326	"nsNodeUtils::CloneAndAdopt"	131
10651	10651	22623	"nsNodeUtils::CloneAndAdopt"	8
10652	10665	322315	"nsNodeUtils::CloneAndAdopt"	107
10653	10664	270219	"nsNodeUtils::CloneAndAdopt"	90
10654	10664	246469	"nsNodeUtils::CloneAndAdopt"	82
10655	10663	201245	"nsNodeUtils::CloneAndAdopt"	67
10656	10656	18571	"nsNodeUtils::CloneAndAdopt"	6
10657	10657	20485	"nsNodeUtils::CloneAndAdopt"	7
10658	10661	89710	"nsNodeUtils::CloneAndAdopt"	30
10659	10659	20879	"nsNodeUtils::CloneAndAdopt"	7
10660	10660	21218	"nsNodeUtils::CloneAndAdopt"	7
10661	10661	19177	"nsNodeUtils::CloneAndAdopt"	6
10662	10663	41447	"nsNodeUtils::CloneAndAdopt"	14
10663	10663	19557	"nsNodeUtils::CloneAndAdopt"	6
10664	10664	17673	"nsNodeUtils::CloneAndAdopt"	6
10665	10665	25684	"nsNodeUtils::CloneAndAdopt"	9
10666	10666	18394	"nsNodeUtils::CloneAndAdopt"	6
10667	10670	87762	"nsNodeUtils::CloneAndAdopt"	29
10668	10668	18734	"nsNodeUtils::CloneAndAdopt"	6
10669	10669	22372	"nsNodeUtils::CloneAndAdopt"	7
10670	10670	16818	"nsNodeUtils::CloneAndAdopt"	6
10671	10713	7114609	"nsCSSFrameConstructor::ConstructFrame"	2362
10672	10706	5224392	"nsCSSFrameConstructor::ConstructFrame"	1735
10673	10674	1157145	"nsCSSFrameConstructor::ConstructFrame"	384
10674	10674	90892	"nsXBLService::LoadBindings"	30
10675	10704	3232536	"nsCSSFrameConstructor::ConstructFrame"	1073
10676	10696	2581555	"nsCSSFrameConstructor::ConstructFrame"	857
10677	10696	2404877	"nsCSSFrameConstructor::ConstructFrame"	798
10678	10694	1938654	"nsCSSFrameConstructor::ConstructFrame"	644
10679	10680	168788	"nsCSSFrameConstructor::ConstructFrame"	56
10680	10680	93528	"nsXBLService::LoadBindings"	31
10681	10682	342305	"nsCSSFrameConstructor::ConstructFrame"	114
10682	10682	187005	"nsXBLService::LoadBindings"	62
10683	10691	1090678	"nsCSSFrameConstructor::ConstructFrame"	362
10684	10685	296337	"nsCSSFrameConstructor::ConstructFrame"	98
10685	10685	179353	"nsXBLService::LoadBindings"	60
10686	10690	637316	"nsCSSFrameConstructor::ConstructFrame"	212
10687	10690	442832	"nsXBLService::LoadBindings"	147
10688	10690	189744	"nsNodeUtils::CloneAndAdopt"	63
10689	10690	162450	"nsNodeUtils::CloneAndAdopt"	54
10690	10690	125963	"nsNodeUtils::CloneAndAdopt"	42
10691	10691	50159	"nsCSSFrameConstructor::ConstructFrame"	17
10692	10694	225528	"nsCSSFrameConstructor::ConstructFrame"	75
10693	10694	144247	"nsCSSFrameConstructor::ConstructFrame"	48
10694	10694	79043	"nsXBLService::LoadBindings"	26
10695	10696	141014	"nsCSSFrameConstructor::ConstructFrame"	47
10696	10696	75633	"nsXBLService::LoadBindings"	25
10697	10704	526839	"nsCSSFrameConstructor::ConstructFrame"	175
10698	10703	275866	"nsXBLService::LoadBindings"	92
10699	10703	109187	"nsNodeUtils::CloneAndAdopt"	36
10700	10703	89594	"nsNodeUtils::CloneAndAdopt"	30
10701	10702	41950	"nsNodeUtils::CloneAndAdopt"	14
10702	10702	19610	"nsNodeUtils::CloneAndAdopt"	7
10703	10703	18304	"nsNodeUtils::CloneAndAdopt"	6
10704	10704	131929	"nsCSSFrameConstructor::ConstructFrame"	44
10705	10706	737956	"nsCSSFrameConstructor::ConstructFrame"	245
10706	10706	78479	"nsXBLService::LoadBindings"	26
10707	10713	1786714	"nsCSSFrameConstructor::ConstructFrame"	593
10708	10709	554771	"nsCSSFrameConstructor::ConstructFrame"	184
10709	10709	83691	"nsXBLService::LoadBindings"	28
10710	10711	580053	"nsCSSFrameConstructor::ConstructFrame"	193
10711	10711	81070	"nsXBLService::LoadBindings"	27
10712	10713	540237	"nsCSSFrameConstructor::ConstructFrame"	179
10713	10713	79557	"nsXBLService::LoadBindings"	26
10714	10720	9597603	"nsDocument::EndUpdate"	3186
10715	10715	5535	"nsDocument::EndUpdate"	2
10716	10716	4291	"nsDocument::EndUpdate"	1
10717	10717	271680	"nsXBLService::LoadBindings"	90
10718	10718	4360	"nsDocument::EndUpdate"	1
10719	10719	4683	"nsDocument::EndUpdate"	2
10720	10720	4414	"nsDocument::EndUpdate"	1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.