Jul 30

Google, which started as just a search engine, has so many tools and services now. Lot of them are useful in everyday life.

Tool Integration related

It is nice to see how these tools/services work with each other so well:

… to mention a few. But there are still quite a few that would be nice to have. Following is a kind of a wish list of some ways Google tools could work together and enhance the user experience - from my perspective:

Google maps still seems like a standalone tool. On its own, it is probably the best online maps website. Some of the new features are really useful. My Maps, re-routing directions, the newly added third party content etc. But Google Maps doesn’t seem to integrate well with rest of the Google tools.

  • It would be nice to be able to pick locations in My Maps as venues in Calendar, for instance
  • How about a My Maps collection of all the Gmail contacts
  • My Maps collection for geo-tagged albums in Picasa Web Albums

Google Calendar is well integrated with Gmail. But it would be nice to have a Google Docs and Spreadsheets document/spreadsheet attached to an appointment. For instance, if the appointment is a party, a spreadsheet of party supplies to be bought, party activities planned, etc.

Other

IMAP access to Gmail must be on the top of many Gmail users’ wish lists. I am hoping that the Gmail team is secretly working on this! If and when IMAP is supported, I’d like to see tags in the header of messages - that can be added and read by the desktop mail application. The current POP access available with Gmail is only good if Gmail is accessed from just one desktop. And the tags, the feature of Gmail that I love the most, is totally useless with POP access.

Google Calendar plugin for iCal is something that I had expected to be out after Mac Team was formed at Google. But hasn’t happened so far. There are other solutions that provide the functionality, but something coming from Google would be nice to have (like the Picasa Web Albums plugin for iPhoto.)

I am sure there is going to be a sequel to this post some time soon, with more wishes. When that happens, I’ll love to see some of the above wishes already granted!

Jul 05

Recently I was investigating why the performance of one of my AJAX experiment is so bad.

This page uses a Perl CGI script to query a handful of deals sites for syndication of their deals and puts them together in one big RSS. Then the Javascript part displays the big collection of deals as a list. The list can be then narrowed down based on keywords as they are typed.

Since the big RSS usually contains more than 300 entries, the Javascript that was converting the entries into list items in an unordered list, was taking upto 10-15 seconds to render. This was not very pleasant.

Here’s how that part of the code looked:

  for ( it = 0; it < items.length; it++) {
    var item = items[it];
    var it_title = item.getElementsByTagName('title').item(0).firstChild.data;
    var it_link  = item.getElementsByTagName('link').item(0).firstChild.data;

    this.port.innerHTML += "<li class=" + it_li_class + "><a href=\\""
                           + it_link + "\\" target=\\"feedr_win\\">"
                           + it_title + "</a>";
  }

After a few experiments, I found that the assignment to this.port.innerHTML was the one that was most expensive. I modified the code to read:

  var html_str = "";

  for ( it = 0; it < items.length; it++) {
    var item = items[it];
    var it_title = item.getElementsByTagName('title').item(0).firstChild.data;
    var it_link  = item.getElementsByTagName('link').item(0).firstChild.data;

    html_str += "<li class=" + it_li_class + "><a href=\\""
             + it_link + "\\" target=\\"feedr_win\\">"
             + it_title + "</a>";
  }

  this.port.innerHTML = html_str;

That cut the time to less than a second. More than a 10x-15x performance improvement.

Next time I write something directly into innerHTML from Javascript in a loop, I am going to try and see if I can collect the text first and then write it into innerHTML.