Comments (1)
결과 (Trie vs Dictionary)
- 인덱싱
- 약 4MB의 명사 문서를 인덱싱하는데 걸리는 시간
- Dictionary
1.51 s ± 66.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) - Trie
19.8 s ± 291 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) - 약 13배 느림 (19.8 s/ 1.51 s).
- 검색
- 다음 9개의 단어 검색하는데 걸리는 시간
words = ['프로', 'c++', 'c#', 'c', '프로그래밍', '야근', '하드웨어', '저수준', '포프'] - n : 인덱스 단어 수, m : 검색 단어 길이
- Dictionary
-. 검색어와 인덱스가 일치하는 검색, O(1)
806 µs ± 13.6 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
-. 검색어로 시작하는 인덱스 검색, O(n)
29 ms ± 482 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) - Trie
-. 검색어로 시작하는 인덱스 검색, O(m)
1.42 ms ± 20 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) - 약 20배 빠름 (29 ms/1.42 ms).
- 결론
- Trie가 Dictionary 대비 인덱싱은 13배 느리고 검색은 20배 빠르다.
- 문서의 양이 적을 때는 Dictionary, Trie의 검색 속도는 체감상 차이가 안난다.
- 테스트 단계에서는 인덱싱이 빠른 Dictionary를 사용하고 실 사용 단계에서는, 문서의 양이 많아지면 Trie를 고려해보자.
from youtube_caption_analyzer.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from youtube_caption_analyzer.