Skip to content

Instantly share code, notes, and snippets.

@hideack
Created January 11, 2015 02:33
Show Gist options
  • Save hideack/e617759b1090b304128a to your computer and use it in GitHub Desktop.
Save hideack/e617759b1090b304128a to your computer and use it in GitHub Desktop.

pt

☁  20141230_wikipedia  time pt コロスケ jawiki-latest-all-titles
jawiki-latest-all-titles:
969851:奈良崎コロスケ
2180964:コロスケ
2180965:コロスケ123123
2180966:コロスケ准将
2180967:コロスケ@1億円

pt コロスケ jawiki-latest-all-titles  0.50s user 0.07s system 112% cpu 0.504 total

grep

☁  20141230_wikipedia  time grep コロスケ jawiki-latest-all-titles
奈良崎コロスケ
コロスケ
コロスケ123123
コロスケ准将
コロスケ@1億円
grep コロスケ jawiki-latest-all-titles  1.50s user 0.02s system 99% cpu 1.524 total

独自

インデックス + 検索

☁  remiera [master] ⚡ node test.js
indexing: 892265ms
search: 1ms
[ '0', '1', '2' ]
[ '0', '1', '2' ]
[ '0', '1', '2' ]
[ '0', '1', '2' ]
[ '3', '4', '5' ]
[ { no: '2180965', pos: '0' },
  { no: '2180966', pos: '0' },
  { no: '2180963', pos: '0' },
  { no: '2180964', pos: '0' },
  { no: '969850', pos: '3' } ]

検索のみ

☁  remiera [master] ⚡ time node test.js
[ '0', '1', '2' ]
[ '0', '1', '2' ]
[ '0', '1', '2' ]
[ '0', '1', '2' ]
[ '3', '4', '5' ]
[ { no: '2180965', pos: '0' },
  { no: '2180966', pos: '0' },
  { no: '2180963', pos: '0' },
  { no: '2180964', pos: '0' },
  { no: '969850', pos: '3' } ]
search: 9ms
node test.js  0.08s user 0.02s system 90% cpu 0.106 total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment