If you have never used either,
you should do it both ways.
Just to learn how to do it.
Normally you should judge this task on time it takes to implement it and time it may take to maintain the code you've created.
Only in rare cases will the execution time (or execution size) of the code you create actually become an issue (for example: if it's part of a compiler that gets used constantly). Only then should it be used as a data point in your decision of what to do.
And of course, most people just do it the way they know how. =)