After much experimentation, it turns out there are a number of very significant things to keep in mind, in order to maximize the trading throughput. I'm answering this with the purpose to maximize the number of emeralds / real world minutes played.
- The Farmer is the best option. Because it is simple to create completely automated pumpkin, wheat, carrot and potato farms.
- Pick a farmer villager that has the best possible trading options for your farms. i.e.
- 16 or fewer carrots / emerald (so you get 4 emeralds / stack instead of 3)
- 16 or fewer potatoes / emerald.
- 8 pumpkins / emerald.
- 20 or fewer wheat / emerald.
- Learn the keyboard short cuts, to minimize mouse movements between your inventory, and the trading window.
- Stage lots of chests of items near the villager to minimize Steve movement.
- Maximize trades with the farmer. That is, completely trade as much wheat as possible, then completely trade as much potatoes as possible etc. Keeping the trading window open the entire time. Once you have gotten every trade closed, then close the trading window. With very high probability all trades will get refreshed.
In my experience (I've traded for about 100 stacks of emeralds) the last bullet point above maximizes the villager's chances of getting the regeneration effect, and reopening all trades. And it's obviously the fastest keyboard/mouse approach.
In my experience, if you trade for a single emerald at a time, and close the trading window between each trade, you are much more likely to close a trade than refresh trades. Basically, if you do single trades you get on average about 32 emeralds before all trades are closed and you have to start buying things with emeralds. (I just have a potato, wheat and carrot farm, I haven't finished the pumpkin farm yet, I suspect the numbers improve with 4 trades). With the bulk trading option, I've only had the villager lock all trades, and not release trades once.
One last note: I have read some commentaries that tell you not to drop items at the villager's feet, because they'll pick them up. This is not quite true. A farmer will pick up 5 full stacks of wheat, potatoes, and/or carrots. (Also seeds, and bread). Once the farmer is "full" he won't pick up anything else, so this is only a very short term issue.