anders.com: javascript: contract data point editor
a client-side editor to manipulate large sets of data
[ home ]
[ anders ]
[ resume ]
[ choppers ]
[ projects ]
  [ netatalk ]
  [ route66 ]
  [ javascript ]
  [ webgallery ]
  [ mockMarket ]
  [ merits ]
  [ dailyBulletin ]
  [ panacea ]
[ words ]
[ pictures ]
[ movies ]
[ contact ]
the problem: a pdf writer application was being used to plot data points over an image. (happens to be an image of a contract) things like the company name and address needed to be included at specific x/y locations in the pdf so an editor was created to associate some data source (such as the company name) with it's apropriate x and y values. these data values would be posted to a database so the pdf writer application could grab them and create a finished contract with everything.

a contract data point editor that used the basic concept from my dynamic form javascript was created to address the problem. however, the resulting user interface quickly becomes unacceptably slow when the number of points climbs. try out the old contract data point editor and add a good number of elements. there will be a clearly noticable slowdown at 10 elements. as some contracts required upwards of 100 elements, you can see how the process becomes unacceptably slow. this happens because there are multiple copies of a very long select list created in memory as a string. as it happens, string operations in javascript are time consuming and as the select list and number of data points will undoubtadly grow over time, it became obvious that this strategy would not work.

the solution was to create a pick list for the select list and add the concept of client side pages from my media browser project to create the new contract data point editor. try adding a large number of elements to the editor and see how the performance doesn't decrease nearly as rapidly.

a graph showing the time savings is available below. i didn't have the patience run the test on more than 60 data points on the old code, but i was able to run the new code to 1000 points. it's delay at 1000 points was 0.17 seconds, or roughly the speed of the old code running with 7 options.