Page 1 of 1

Making a big grid

Posted: Mon Jul 31, 2006 10:19 am
by antubis
Hello,

I should create a very big grid - 4000 small boxes. But this is very resource-eating process. The site become 400K big ... wow. And every browser stop responding for the time of the loop. Can u tell me how can I create this grid with small resources? Maybe to do this on client side with JS ... but I don`t have an idea how can I do this.

Thanks to all!

Posted: Mon Jul 31, 2006 10:28 am
by feyd
That size grid will be large no matter how you create it.

Posted: Mon Jul 31, 2006 10:29 am
by RobertGonzalez
What is your current process? Post code if you have any.

Posted: Mon Jul 31, 2006 10:41 am
by themurph
IF all 4000 items do not have to be displayed at one time on one page, you use a Pager function/class to display them in blocks.

Posted: Mon Jul 31, 2006 10:49 am
by antubis
The idea is to hide a background images with many boxes ( 4000 ). When user click on image he can post a message ot this box, and the box will become transparent. The background image slowly will be displayed.
So .. you said there isn`t any user-friendly way to create this?

Posted: Mon Jul 31, 2006 5:42 pm
by themurph
What are the dimensions of each box? How many bytes is each sectional image?
I'd say optimize the crap out of every image involved.. and try and scale down the
number of cross-sections you are cutting up. (400 boxes instead of 4000).

Still not 100% sure what you are trying to do...

Posted: Mon Jul 31, 2006 5:45 pm
by panic!
have you considered *shudder* Flash?

Posted: Mon Jul 31, 2006 9:32 pm
by RobertGonzalez
If you are trying to actually offer 4000 different content squares, you are going to be up against one heck of a task in optimizing that thing. Especially after you start throwing content attached to it. Imagine running a loop to display 4000 squares, and within each square having to check whether their is something that needs to be displayed in that square.

Now imagine that you have traffic and that script is being called by, say, 1000 concurrent users. That could pose some problems.

Posted: Tue Aug 01, 2006 1:27 am
by antubis
Yep ... the situation is the same as you describe it. Can u tell me some alternatives? I have somethink in mind.
1. In the begining of opening the page, there is a flash with a preloader. I can attach the html returned from php script to another JS preloader, so it will be cached when u try to open it.

2. With a cron-job in every 10/30 mins a html file will be destoried, and on its place a new one will be created.

3. To create this grid on client-side - with JS. A loop for 4000 appendChild is fast, but I don`t know how to give a "<a href"> param to already created div.
If you think someone of this can solved my problem, all you have a better decision, please, share it with me.

Regards,
Marush Denchev

Posted: Tue Aug 01, 2006 8:39 am
by RobertGonzalez
I can't think of a fast way to do this. Of course, I am operating on very little caffeine right now, but if I come up with anything I will be sure to post back.

This just seems like a very intense operation for the code, more than anything because there is a lot of output to manage and the time it takes to do that could exceed the time that your users would want to spend watching it