<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Disqus - Latest Comments for Michel Hegeraat</title><link>http://disqus.com/people/8e2ae04ebf5e1bb8d16b5c836bbf36a5/</link><description></description><language>en</language><lastBuildDate>Sun, 03 Jun 2007 01:56:35 -0000</lastBuildDate><item><title>Re: Cuppadev &amp;raquo; Javascript Draw</title><link>http://cuppadev.disqus.com/cuppadev_raquo_javascript_draw/#comment-2429517</link><description>I'm trying to show a layer2 map of connected devices.&lt;br&gt;&lt;br&gt;I figured out a way to do this creating a div for each line and device basically allowing me to update these individually using a ajax poll of a page that can reports any changes.&lt;br&gt;&lt;br&gt;I found that when you have many div's it seems to be more and more time consuming to access the div. e.g. if we have 10 device then moving a device while redrawing the lines takes half a second. If we have 200 devices then moving a device while redrawing the same 2 lines takes 10 seconds.&lt;br&gt;&lt;br&gt;I guess this shows that the browser has to search the div in the current document. I already started using an array to hold the reference to a div but this doesn't change anything. It' is like if the browser has to sequentially go through the source to find the right div.&lt;br&gt;&lt;br&gt;I guess I need something like SVG to get the performance right.&lt;br&gt;&lt;br&gt;Would there be any performance gain in using an object oriented style of javascript? I guess not as there is no way to associate the contents of a dom object with the property of a line or device object.&lt;br&gt;&lt;br&gt;I wonder what the canvas approach would add and how easy or difficult it would be to trap events like drag drop and click.&lt;br&gt;&lt;br&gt;Is line drawing faster when no div's are used?&lt;br&gt;&lt;br&gt;Would it be possible to see you source? The files in the example are not very readable and I guess I like source especially when there comments hinting me what each part is doing ;-)&lt;br&gt;&lt;br&gt;If you are interested is my sources feel free.&lt;br&gt;&lt;br&gt;Cheers,&lt;br&gt;&lt;br&gt;Michel</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michel Hegeraat</dc:creator><pubDate>Sun, 03 Jun 2007 01:56:35 -0000</pubDate></item></channel></rss>