bad idea - wanted faster json

class Point2(object):
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def for_json(self):
        return {'x': self.x, 'y': self.y}
    def for_json_raw(self):
        return '{{x: {}, y: {}}}'.format(self.x, self.y)

points2 = [Point2(i, i + 1) for i in xrange(0, 1*1000*1000)] #with for_json takes 62.36s
                                                   #with for_json_raw takes 68s WTF?
simplejson.dumps(points2, for_json=True)

I forgot just how expensive calls are in python and so the raw text generation is more expensive than dictionary generation.