These are chat archives for rust-lang/rust

19th
Mar 2018
Vyacheslav Kim (Kane)
@kanekv
Mar 19 2018 06:42
Does tokio utilize all cores by default?
Zakarum
@omni-viral
Mar 19 2018 08:49
Does tokio utilize cores for you? I thought the user is responsible to run tasks
Ayushya Chitransh
@AyushyaChitransh
Mar 19 2018 09:55
is string.len() an O(1) operation?
Roman Akberov
@RomanAkberov
Mar 19 2018 09:57
@AyushyaChitransh yes, it is the length in bytes.
Ayushya Chitransh
@AyushyaChitransh
Mar 19 2018 10:00
So len is not same as the number of characters?
Michal 'vorner' Vaner
@vorner
Mar 19 2018 10:01
No, it's not. And it's not really even clear what the number of characters is. Number of code points? Number of graphemes?
Ayushya Chitransh
@AyushyaChitransh
Mar 19 2018 10:04
:sweat_smile: both these terms were new for me, code points and graphemes, and am glad to have asked this question. Its more clear now. Thanks :)
Michal 'vorner' Vaner
@vorner
Mar 19 2018 10:08
For example, the letter „Á“ can be one or two code points (either as one letter or composed from separate accent and the letter A), but is one grapheme. You are allowed to split it into the two if it is the two code points, but not if it's one, but I think it'll be 2 bytes long either way.
Ayushya Chitransh
@AyushyaChitransh
Mar 19 2018 10:33
@vorner Do most languages use grapheme to calculate number of characters?
Michal 'vorner' Vaner
@vorner
Mar 19 2018 10:34
I think most languages use code points.
Vyacheslav Kim (Kane)
@kanekv
Mar 19 2018 15:12
@omni-viral so tokio reactor is single threaded?
Zakarum
@omni-viral
Mar 19 2018 15:39
@Kane-Sendgrid looks like it. But I'm not an expert in tokio :smile:
Christian Witts
@ChristianWitts
Mar 19 2018 15:44
https://tokio.rs/blog/2018-02-tokio-reform-shipped/ Tokio v0.1 makes it “easy” to have {single,multi}-threaded based apps
Vyacheslav Kim (Kane)
@kanekv
Mar 19 2018 15:45
cool, yep, found it. looks like tokio-core was single-threaded, tokio supports ::spawn