Comments (2)
Hey @crudiedo.
I tried your repo and here are my results:
Naive time: [58.785 ms 58.823 ms 58.860 ms]
BTreeSet time: [13.723 ms 13.728 ms 13.733 ms]
RoaringBitmap time: [13.142 ms 13.148 ms 13.154 ms]
HashSet time: [10.567 ms 10.578 ms 10.591 ms]
it's funny that the Naive approach has a lower performance than on your computer. 🤯
I think that using a HashSet is a good idea too, nice job! 👍
You can create a PR by replacing the current Hebrew normalizer, it is a good base to introduce your work, therefore, nonspacing marks include the Hebrew diacritics.
from charabia.
Hi everyone,
I’ve got the implementation prepared for the PR, but first wanted to agree on the data structure we’re going to use.
As proposed, I’ve made a sample app and did some benchmarking - you can find it there:
https://github.com/crudiedo/nonspacing-bench
The results are quite interesting - it looks like the built-in HashSet structure performs better than roaring bitmap (at least on my machine and using the 1.5MB sample text):
Naive time: [22.296 ms 22.378 ms 22.461 ms]
BTreeSet time: [14.278 ms 14.335 ms 14.394 ms]
RoaringBitmap time: [15.217 ms 15.274 ms 15.333 ms]
HashSet time: [9.5395 ms 9.5683 ms 9.5972 ms]
Of course there's still a memory difference matter, but I believe the speed is the priority especially since there are only 1281 marks to store.
I'm still not sure how to properly measure data structure size in Rust (besides 4 bytes for u32 * 1281 lol), so I used jemalloc
and it's 328480
bytes allocated for a sample using hashset
vs 289632
for roaring
one.
So I believe we should be good with HashSet (or BTreeSet if I'm missing something about HashSet), and there's no need to use RoaringBitmap.
Thanks, let me know your thoughts and I'll move forward with submitting PR (:
from charabia.
Related Issues (20)
- Upgrade dependencies HOT 7
- Korean support
- Refactor normalizers
- Implement Vietnamese tokenizer for Meilisearch HOT 2
- Latin script: segmenter should support word segmentation HOT 5
- clippy CI fail with latest toolchain
- Greek Script: Normalize accents
- Greek script: Normalize Sigma
- Publish hfhchan kvariants wrapper on crates.io HOT 3
- Create a CI keeping kvariants up-to-date HOT 2
- Arabic script: Add an Normalizer removing Tatweel
- add support for khmer language
- Fix compilation without `greek` feature enabled
- Chinese segmentation not correct HOT 2
- Tokenization of japan text with disabled default features HOT 3
- Test this library against invalid and strange input
- Implement the `CharNormalizer` trait on the `LowercaseNormalizer` struct
- Ð vs Đ differentiate HOT 7
- Add Khmer support information to README
- remove unnecessary iteration in khmer segmenter HOT 2
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 charabia.