BFTB - Wet Paint

That's better! Site Updates!
Post Reply
User avatar
Squad Leader
The Eagle Has Landed
The Eagle Has Landed
Posts: 1412
Joined: 22 Feb 2009 21:00
Location: Buckinghamshire
Contact:

Re: BFTB - Wet Paint

Post by Squad Leader »

The Baron wrote:Afraid not. Are you sure it's the reason your fan is going? Are you on about the CPU fan or a case fan?
not sure what fan it is but its bloody noisy :-?

tried monkfish's tip and that stopped it but some of the features on the site wouldn't work then :-(

....gonna have to get myself some earplugs :lol:

:eagle2:

User avatar
The Baron
World Enemy No. 1
World Enemy No. 1
Posts: 14726
Joined: 18 Sep 2012 05:10
Location: Secret HQ
Contact:

Re: BFTB - Wet Paint

Post by The Baron »

The CPU fan is the one in the middle of your motherboard, attached to your processor. The case fans are on the sides of your PC case.

I've just removed all of the other javascript* from the rest of the site in favour of flash - what stopped working when you disabled Java, please?

* barring the Mutour map and homepage bookmarks feature.

User avatar
The Baron
World Enemy No. 1
World Enemy No. 1
Posts: 14726
Joined: 18 Sep 2012 05:10
Location: Secret HQ
Contact:

Re: BFTB - Wet Paint

Post by The Baron »

Monkfish wrote:the code author acknowledges that it is cpu intensive
Only when using the addiitonal christmas lights.

http://www.schillmania.com/projects/snowstorm/

Monkfish
Space Force
Space Force
Posts: 346
Joined: 25 Mar 2009 01:11
Location: Newfoundland, Canada

Re: BFTB - Wet Paint

Post by Monkfish »

Sorry, but it's heavy on the cpu in either case, albeit "notably lower" without the Christmas Lights.

I've tested it (without the lights) with Safari and Firefox. The former sees approx 70% cpu use and the latter around 100%, both cases with no other applications running. Move off the site or switch off the snow and the cpu usage drops down to a negligible level.

I'm not fluent in javascript, or in particular the nuances of its thread handling (my language is the close relative java) but having had a quick look I think the code might have a bit of busy waiting in it, meaning that the code loops when waiting to do other things, which makes it hungry for cpu cycles. I once had similar issues with an applet I embedded in a webpage, even when paused.

If you open Task Manager in Windows (or Activity Monitor in os-x) you can see the difference with and without the snow.

User avatar
The Baron
World Enemy No. 1
World Enemy No. 1
Posts: 14726
Joined: 18 Sep 2012 05:10
Location: Secret HQ
Contact:

Re: BFTB - Wet Paint

Post by The Baron »

Strewth - you're right, my CPU usage leaps from 2% to 32%.

I'll start up a poll to see how many members are being affected by it.

User avatar
Chopper
This is what you get when you mess with the SAS
This is what you get when you mess with the SAS
Posts: 7221
Joined: 09 Apr 2003 08:30
Location: Melbourne

Re: BFTB - Wet Paint

Post by Chopper »

Not half wrong, just watched Firefox jump up and down in task manager. It bounces back between 4% and 96%. I can also see java going up and down like a brides nightie, in between use mind you.

Monkfish
Space Force
Space Force
Posts: 346
Joined: 25 Mar 2009 01:11
Location: Newfoundland, Canada

Re: BFTB - Wet Paint

Post by Monkfish »

Had a really good look at the javascript and, apart from spotting a couple of slight gains to be made by trimming some unneeded 'if' statements and perhaps using stacks to track active and inactive flakes I couldn't see a lot to do to.

Then I had a look again at the author's web page and he's slightly updated the code to use bulletpoints for snowflakes instead of image files - and this significantly reduces the cpu load - more than halves it using Safari on my laptop. Saves hosting the snow image file too. Version 1.4.20091115.

Oh, and you can muck around with this.snowColor too if you want... (try going from fff to d00)

Might be worth a look.

User avatar
The Baron
World Enemy No. 1
World Enemy No. 1
Posts: 14726
Joined: 18 Sep 2012 05:10
Location: Secret HQ
Contact:

Re: BFTB - Wet Paint

Post by The Baron »

I'll give it a go.

User avatar
The Baron
World Enemy No. 1
World Enemy No. 1
Posts: 14726
Joined: 18 Sep 2012 05:10
Location: Secret HQ
Contact:

Re: BFTB - Wet Paint

Post by The Baron »

Any better?

Monkfish
Space Force
Space Force
Posts: 346
Joined: 25 Mar 2009 01:11
Location: Newfoundland, Canada

Re: BFTB - Wet Paint

Post by Monkfish »

Yes, although there is a compounding effect when it runs on a forum page.

When I run the script at http://www.bloodforthebaron.com/snow/sc ... owstorm.js in a simple blank page with black background I get CPU usage around the 30% mark. A forum page comes closer to 50% average - it's come down from the 70% seen before, but it could be that the browser's need to re-draw pixels on the page where the snow has been is having an effect (which I think is out of the author's control).

Altering the maximum number of flakes and active flakes might help (but there's a payoff in appearance) but beyond that I'm unfortunately stuck - sorry.

Post Reply

Return to “Updates”