Jump to content

Recommended Posts

Hi everyone,

 

I am new here, so please go easy on me :) 

 

Currently I am drawing a table, with roughly ~250,000 cells.  Each cell is unique, and is clickable (each cell contains a unique onclick function). 

Upon each click I am calling ajax to query multiple databases.

My problem lies in the drawing of this 250,000 cell table.  The rendering of this table can take ~2 minutes on a fairly fast computer.

 

Is there anything I can do to speed up the rendering?  Drawing a 25,000 cell table is no problem (10 secs rendering).  But I would like to draw this large table in that same time.

 

This is a live web application and would like it to stay that way. (no standalone code).

I would be willing to switch to java/c++/perl cgi if the performance gain was great enough.

 

Any ideas?

 

Thanks!

 

 

Link to comment
https://forums.phpfreaks.com/topic/106236-drawing-large-table-250000-cells/
Share on other sites

Here is some simplified sample code for what I am trying to do...

 

 

save as test.php

<table bgcolor='black'>
  <?php
for($tr=0;$tr<1500;$tr++) {
     echo "<tr height=5>";
      for($td=0;$td<100;$td++) {
         echo "<td bgcolor='blue' width=5></td>";
      }
      echo "</tr>";
   }
   ?>
</table>

 

I have read that specifying a fixed size should help things.  As well as specifying a COLGROUP tag?

But nothing I have tried helps just yet...

 

Thanks!

There is absolutely no reason for you to bringing up over 250,000 cells. Let alone, more than 1,000 cells. Your application is poorly designed. You should try to cut it down.  :-\

 

Maybe having a search feature, or viewing every 500 records?

This is a data visualization application.

It is a heatmap tool.  Each cell is colored according to its associated value.  There is no printed text in each cell.

 

The point of this application is to spot trends, or data clusters using the human eye.

 

I realize I can use a search feature or only display X number of points.  However it would be ideal to view all at once...

 

I also realize that I could build the image on the backend and then use imagmaps to allow each cell to be clickable.

I am just looking for any hints on how to optimize/enhance the table rendering.

 

thanks!

 

 

 

 

 

Yeah, I would draw the image (using GD). Depending on how long that takes, you may need to cache it, and only update it every 5 minutes or so. Then, use an onclick on the entire image, and send the coordinates as to where you clicked on the image over the AJAX. That way it's just one onclick.

I appreciate all of the help.

 

I was worried that I would run into the same problems drawing a 250,000 cell imagemap. 

But organizing the coordinates in a way to control the onlicks is a great idea.

 

Thanks everyone - I will give it a shot.

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.