开发者

Which is slower, StringTokenizer or SQLite insert

I'm making a flashcard app, that has about 1000 words in 6 different languages (total 6000 words). They initially are in a text file, and when the app first runs, I install into the SQLite database the words for 2 languages (the UI lang and 1 other).

If the user ever changes the UI (selectable through a menu), then I install the 1000 words for thi开发者_如何学Cs language from the text file into the database.

The text file format is something like: wordid,actualtext,language (1 per line).

What the code does is read the whole file, split it with StringTokenizer, and depending on the language value, install into the DB.

I did this supposing that the install into the database would take alot more than the splitting of the file by StringTokenizer. However if this is not true, it would be better to just install all words and languages, so the user would only have to wait once, and not each time he changes the UI language.

Does anyone have any info or suggestions regarding this?

Thanks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜