When you do an explain() operation, you can see how the Traversal looks to the underlying graph database. If the database was capable of optimizing on the order() in this case, it could take advantage of that and become more efficient. If you simply submitted, g.V().hasLabel("person") and then switched to groovy collection methods, the underlying database would only know that you were trying to get the list of "person" vertices and not know you also intended to order them (which would then happen in memory with the use of the groovy sort).