It is currently Thu Mar 28, 2024 4:58 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
Offline
 Post subject: Technical Details on Slow Thread With Many Embedded SGFs
Post #1 Posted: Sun Aug 02, 2020 8:40 am 
Tengen

Posts: 4380
Location: North Carolina
Liked others: 499
Was liked: 733
Rank: AGA 3k
GD Posts: 65
OGS: Hyperpape 4k
We have a thread that takes an extremely long time to render: https://lifein19x19.com/viewtopic.php?f=13&t=17570. It has dozens of SGFs, and takes around a minute to fully render on my 2015 MacBook (though I might have some background stuff or other things that inflate that number). I thought I'd make a thread to record any technical discussion and not pollute the main thread.

I thought using [hide] tags might work. Tryss said he thought the number of variations was driving the slowness.

I did the laziest "investigation" possible, and opened the page with Chrome performance tools. I saw repeated cycles of long running tasks, with the biggest time driven by layout and paint. To me, that makes me curious if we're having an O(n^2) problem where each SGF triggers a new layout and paint for the entire document. Hopefully hide tags might either avoid the repeated layouts, or make them faster? Honestly, I'm not that familiar with the DOM mechanics here.

I assume we don't have an appetite for patching Eidogo to avoid the repeated layouts.

_________________
Occupy Babel!


This post by hyperpape was liked by: ez4u
Top
 Profile  
 
Offline
 Post subject: Re: Technical Details on Slow Thread With Many Embedded SGFs
Post #2 Posted: Sun Aug 02, 2020 9:43 am 
Tengen

Posts: 4380
Location: North Carolina
Liked others: 499
Was liked: 733
Rank: AGA 3k
GD Posts: 65
OGS: Hyperpape 4k
Looks like the eidogo iframe is added to the page using document.write. I wonder if we could do a hack, and leave the document.write calls there, but write a dummy element, then attach an event handler for DomContentLoaded and then replace the element with the iframe. (Note: DomContentLoaded is available in IE9 and up, so we'd be losing eidogo support for IE 7 & 8, but do we care?).

The other question is whether making some of the eidogo scripts async would be helpful at all. It would presumably make the posts show up earlier, but it's not clear to me whether it would make the overall time to render any better.

_________________
Occupy Babel!

Top
 Profile  
 
Offline
 Post subject: Re: Technical Details on Slow Thread With Many Embedded SGFs
Post #3 Posted: Sun Aug 02, 2020 9:49 am 
Lives in gote

Posts: 617
Liked others: 154
Was liked: 117
Rank: OGS ddk
KGS: Ferran
IGS: Ferran
OGS: Ferran
IME, It starts slowing down on REload, but does the first render decently.

I tried using hide on the first league, IIRC, but something wouldn't let me. Can't recall what. Time permitting, I'll try to substitute the files with the trimmed games and link to the game page on OGS. Right now, however, I'm not even following the game. They're on move 150+ of today's first game, but I have something else that IRQs me.

Take care

_________________
一碁一会

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group