Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It was a find_iter() across \w+. There was other surrounding code that might have affect the output (it emitted (String, position pairs).

I will try to isolate a test case and reach out...

BTW, your fst is great stuff.



Thanks! If you come up with an example I'd love to see it.

Generally, even though `\w` in Rust's regex library supports Unicode, it shouldn't result in a slow-down compared with the non-Unicode `\w`, assuming you're using find_iter. (Of course, Unicode support isn't free, but the primary cost here is memory and compile time, not matching performance.)

If you were indeed emitting `String` (a new allocation for every match) instead of `&str`, then that could certainly be a possible explanation for the slow down.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: