petl-developers / petl

Python Extract Transform and Load Tables of Data
MIT License
1.25k stars 193 forks source link

recast() should cache sorted data #369

Open alimanfoo opened 8 years ago

alimanfoo commented 8 years ago

recast() requires a sort, however currently the sort is executed every time the table is iterated over, which is unnecessary. Rather recast() should perform the sort only once then re-use the cached sort result.

alimanfoo commented 8 years ago

Btw should be a good opportunity to fix #297 also, and ensure only a single pass is made through the data (#35).