diff options
| author | KOBAYASHI Shuji <[email protected]> | 2019-10-23 19:03:39 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2019-10-23 19:03:39 +0900 |
| commit | 06bd4ffdafdaf7b18abeec22fa962d77673a72f3 (patch) | |
| tree | 96ad0b592ec116f91fb3906df46f71e2d6b272d3 /tasks | |
| parent | fa85f91e0e3ebff7b2626bfcf550821445c064d7 (diff) | |
| download | mruby-06bd4ffdafdaf7b18abeec22fa962d77673a72f3.tar.gz mruby-06bd4ffdafdaf7b18abeec22fa962d77673a72f3.zip | |
Optimize `str_subseq` with `MRB_UTF8_STRING` to ASCII only string
### Benchmark (with `MRB_UTF8_STRING`)
```ruby
# benchmark.rb
COUNT = 300000
SIZE = 10000
s = "a" * SIZE
s.size # set `MRB_STR_ASCII` flag
i = 0
while i < COUNT
s[-1]
i += 1
end
```
#### Before this patch:
```
$ time mruby benchmark.rb
2.06 real 2.05 user 0.00 sys
```
#### After this patch:
```
$ time mruby benchmark.rb
0.05 real 0.04 user 0.00 sys
```
Diffstat (limited to 'tasks')
0 files changed, 0 insertions, 0 deletions
