Making a big grid
Moderator: General Moderators
-
antubis
- Forum Newbie
- Posts: 16
- Joined: Sun Apr 30, 2006 1:48 pm
- Location: Pavlikeni, Bulgaria
- Contact:
Making a big grid
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!
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!
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
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.
Now imagine that you have traffic and that script is being called by, say, 1000 concurrent users. That could pose some problems.
-
antubis
- Forum Newbie
- Posts: 16
- Joined: Sun Apr 30, 2006 1:48 pm
- Location: Pavlikeni, Bulgaria
- Contact:
Yep ... the situation is the same as you describe it. Can u tell me some alternatives? I have somethink in mind.
Regards,
Marush Denchev
If you think someone of this can solved my problem, all you have a better decision, please, share it with me.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.
Regards,
Marush Denchev
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
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
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