In Glasserman's book, he computes the price of an option by first computing the average price over each simulated price path. Once all the paths have been simulated, the average of all the payoffs is computed using the average price of each simulated path.
In the finance courses I have taken, the algorithm I have been taught is to compute all the simulated price paths, work out the payoff of each path and then take the average payoff which is then discounted.
Glasserman's algorithm involves more computation steps since for each price path I have to compute this average price. Why does Glasserman take this approach? Also if there is anybody working in the industry, what algorithm is actually taken to pricing vanilla options i.e. does industry follow the textbook approach or do they apply any other optimisation techniques?