• Tom

      This was done in java six. I didn’t realise there’d be a difference, perhaps they’ve optimised it. I’ll run it again tomorrow on 6&7 and post up a comparison.

  1. Rim

    thank you for the interesting experiments

    here the perf results with java7,
    Split: 262ms
    IndexOf: 68ms
    StringTokenizer: 122ms
    IndexOf2: 24ms
    Split: 154ms
    IndexOf: 50ms
    StringTokenizer: 96ms
    IndexOf2: 16ms
    Split: 156ms
    IndexOf: 48ms
    StringTokenizer: 98ms
    IndexOf2: 11ms

Leave a Reply