GMail slows down

« previous entry | next entry »
Apr. 2nd, 2005 | 08:44 am

I was surprised to see the counter on GMail's front page still there. The quota really has been increased to 2050MB, as promised. The conter made me wonder how far they were going. Infinity+1?

Well, the quota count is managed by this chunk of code:
var CP = [
[ 1112331600000, 1025 ],
[ 1112439600000, 2050 ],
[ 1113062400000, 2075 ]
];

function updateQuota() {
  if (!quota) {
    return;
  }

  var now = (new Date()).getTime();
  var i;
  for (i = 0; i < CP.length; i++) {
    if (now < CP[i][0]) {
      break;
    }
  }
if (i == 0) {
    setTimeout(updateQuota, 1000);
  } else if (i == CP.length) {
    quota.innerHTML = 'Over ' + CP[i - 1][1];
  } else {
    var ts = CP[i - 1][0];
    var bs = CP[i - 1][1];
    quota.innerHTML = format(((now-ts) / (CP[i][0]-ts) * (CP[i][1]-bs)) + bs);
    setTimeout(updateQuota, 50);
}


Cute, yes? It
  1. Finds where the current time is in the list (the for loop)
  2. Computes the difference in sizes (CP[i][1] - CP[i-1][1]) and time (CP[i][0] - CP[i-1][0])
  3. Calculates size/time to get how much it should add to the quotea
  4. Sets up a timer to call itself (to update the quota again)


Why it recalculates everything is beyond me and the for loop could be written for(i in CP) ... ahem, the point is that the counter is approaching certain values on a schedule. The times and sizes stored in CP are:
timetarget size
Fri Apr 01 2005 00:00:00 GMT-0500 (EST)1025
Sat Apr 02 2005 06:00:00 GMT-0500 (EST)2050
Sat Apr 09 2005 12:00:00 GMT-0400 (EDT)2075


So, althought the quota is still increasing, it's doing so much slower than yesterday (4.2% of the previous rate).

Link | Leave a comment | Add to Memories | Tell a Friend

Comments {11}

sinclair_furie

(no subject)

from: [info]sinclair_furie
date: Apr. 3rd, 2005 12:22 am (UTC)
Link

Stupid second derivatives. But now it makes more sense than it did!

Reply | Thread

turn_away__

(no subject)

from: [info]turn_away__
date: Apr. 8th, 2005 12:12 pm (UTC)
Link

calculus huh?

(came to your journal off [info]gmail)

cheers :D

Reply | Parent | Thread

(no subject)

from: [info]edge_walker
date: Apr. 7th, 2005 04:07 pm (UTC)
Link

the for loop could be written for(i in CP)

Nope, then i will also iterate over the array’s properties such as length, rather than just the indices.

Reply | Thread

Atrus

(no subject)

from: [info]nikolasco
date: Apr. 7th, 2005 05:34 pm (UTC)
Link

Yes, I'd forgotten about that. Too used to using objcts just as arrays :P

By the way, how did you come across this?

Reply | Parent | Thread

(no subject)

from: [info]edge_walker
date: Apr. 7th, 2005 07:02 pm (UTC)
Link

Via Phil Ringnalda.

Reply | Parent | Thread

Atrus

(no subject)

from: [info]nikolasco
date: Apr. 7th, 2005 07:31 pm (UTC)
Link

Interesting ... I've never commented in his blog (I think). I did link his post about the Mark Pilgrim scripts, which I picked up from Planet Mozilla. This also explains why I didn't see the link; only his mozilla category is syndicated on the Planet.

Thanks.

Reply | Parent | Thread

ceejayoz

(no subject)

from: [info]ceejayoz
date: Apr. 7th, 2005 09:33 pm (UTC)
Link

So how long until infinity+1?

;-)

Reply | Thread

ceejayoz

(no subject)

from: [info]ceejayoz
date: Apr. 8th, 2005 12:55 pm (UTC)
Link

Maybe if I e-mail them and tell them it's taking too long?

Reply | Parent | Thread

Atrus

(no subject)

from: [info]nikolasco
date: Apr. 8th, 2005 12:25 pm (UTC)
Link

ETA: ∞</a> :P

Infinity is a hard thing to outpace. Maybe GMail could "outpace countable infinity" by increasing the quota by fractions1 (like the counter shows)

1the cardinality ("size") of real numbers is greater than that of integers

Reply | Parent | Thread

Reached 2075...

from: anonymous
date: Apr. 10th, 2005 11:42 am (UTC)
Link

Well, it's reached its peak at 2075 megs and just displays 'Over 2075 megabytes and counting'. But my gmail account says I'm using 38MBs of my 2078... I guess its still growing but the Javascript needs to be updated.

Reply | Parent | Thread

Atrus

Re: Reached 2075...

from: [info]nikolasco
date: Apr. 10th, 2005 12:04 pm (UTC)
Link

It's been fixed. The schedule is:
var CP = [
[ 1112439600000, 2050 ],
[ 1113062400000, 2075 ],
[ 1113685200000, 2100 ]
];


The last element adds the deadline for 2100MB. It's scheduled for 4/16/2005 5pm. So, it seems they plan to add 25MB a week, at least for a while. They're also intentionally keeping the time periods fairly small.

The reason you "run out of schedule" is probably due to the times being local (they don't adjust for timezones).

Reply | Parent | Thread