I'm trying to write a 3D OBJ file parser for the iPhone/iPad and am trying to figure out the absolute fastest 开发者_运维知识库method to do this. I'm not super familiar with c++ but have a few ideas. Some of the ideas I had on how to approach this were to read the whole file into a string then parse from there. Another idea was to read the file line by line and put it into vectors, but that sounds like it might be slower. I know there are a lot of tricks to make c++ extremely fast. Anyone want to take a stab at this? After I parse the file, I'm going to re-save it as a binary file for fast loading on subsequent startups. Thanks.
Check this source: http://code.google.com/p/iphonewavefrontloader/ It works pretty fast, so you can learn how it is implemented.
精彩评论