Does anyone know what the performance consequences are when using the document() function? Tips on improving performance are welcome.