<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/strftime.c, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Remove unused or wrong conversions</title>
<updated>2024-10-20T10:33:21+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-10-20T10:33:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=75ef89ca16d2c94e845b80e8b97bfc811370a890'/>
<id>75ef89ca16d2c94e845b80e8b97bfc811370a890</id>
<content type='text'>
The GMT offset and zone fields are not used in calculating the week
number, and `zone` in `struct vtm` is a `VALUE` and should not be cast
to `char *` at least.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The GMT offset and zone fields are not used in calculating the week
number, and `zone` in `struct vtm` is a `VALUE` and should not be cast
to `char *` at least.
</pre>
</div>
</content>
</entry>
<entry>
<title>Time#strftime: avoid repeated coderange scanning</title>
<updated>2024-09-04T14:12:50+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2024-09-04T10:52:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=294dad22d7ac5f307d567cff897507b9fd9d05e9'/>
<id>294dad22d7ac5f307d567cff897507b9fd9d05e9</id>
<content type='text'>
Followup: a3f589640fd443deea230c27efd6bdfc92f5817f

Restarting scanning has a fixed cost. Since we build a string
from many small parts, that causes the scan to restart many times.

It's much faster to ignore the coderange, if it's needed later it
will be faster to scan it in one go.

```
compare-ruby: ruby 3.4.0dev (2024-09-04T11:54:06Z opt-strftime-growth 149480f0ff) +YJIT [arm64-darwin23]
built-ruby: ruby 3.4.0dev (2024-09-04T11:55:26Z opt-strftime-coder.. 29a5153cba) +YJIT [arm64-darwin23]
warming up...

|                            |compare-ruby|built-ruby|
|:---------------------------|-----------:|---------:|
|time.strftime("%FT%T")      |      1.870M|    2.225M|
|                            |           -|     1.19x|
|time.strftime("%FT%T.%3N")  |      1.731M|    2.068M|
|                            |           -|     1.19x|
|time.strftime("%FT%T.%6N")  |      1.744M|    2.073M|
|                            |           -|     1.19x|
```

Cumulative with a3f589640fd443deea230c27efd6bdfc92f5817f:

```
compare-ruby: ruby 3.4.0dev (2024-09-04T11:55:26Z opt-strftime-coder.. 29a5153cba) +YJIT [arm64-darwin23]
built-ruby: ruby 3.4.0dev (2024-09-04T12:57:30Z opt-strftime-coder.. 2b938d667a) +YJIT [arm64-darwin23]
warming up...

|                            |compare-ruby|built-ruby|
|:---------------------------|-----------:|---------:|
|time.strftime("%FT%T")      |      1.784M|    2.277M|
|                            |           -|     1.28x|
|time.strftime("%FT%T.%3N")  |      1.504M|    2.056M|
|                            |           -|     1.37x|
|time.strftime("%FT%T.%6N")  |      1.489M|    2.094M|
|                            |           -|     1.41x|
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Followup: a3f589640fd443deea230c27efd6bdfc92f5817f

Restarting scanning has a fixed cost. Since we build a string
from many small parts, that causes the scan to restart many times.

It's much faster to ignore the coderange, if it's needed later it
will be faster to scan it in one go.

```
compare-ruby: ruby 3.4.0dev (2024-09-04T11:54:06Z opt-strftime-growth 149480f0ff) +YJIT [arm64-darwin23]
built-ruby: ruby 3.4.0dev (2024-09-04T11:55:26Z opt-strftime-coder.. 29a5153cba) +YJIT [arm64-darwin23]
warming up...

|                            |compare-ruby|built-ruby|
|:---------------------------|-----------:|---------:|
|time.strftime("%FT%T")      |      1.870M|    2.225M|
|                            |           -|     1.19x|
|time.strftime("%FT%T.%3N")  |      1.731M|    2.068M|
|                            |           -|     1.19x|
|time.strftime("%FT%T.%6N")  |      1.744M|    2.073M|
|                            |           -|     1.19x|
```

Cumulative with a3f589640fd443deea230c27efd6bdfc92f5817f:

```
compare-ruby: ruby 3.4.0dev (2024-09-04T11:55:26Z opt-strftime-coder.. 29a5153cba) +YJIT [arm64-darwin23]
built-ruby: ruby 3.4.0dev (2024-09-04T12:57:30Z opt-strftime-coder.. 2b938d667a) +YJIT [arm64-darwin23]
warming up...

|                            |compare-ruby|built-ruby|
|:---------------------------|-----------:|---------:|
|time.strftime("%FT%T")      |      1.784M|    2.277M|
|                            |           -|     1.28x|
|time.strftime("%FT%T.%3N")  |      1.504M|    2.056M|
|                            |           -|     1.37x|
|time.strftime("%FT%T.%6N")  |      1.489M|    2.094M|
|                            |           -|     1.41x|
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Time#strftime: grow the buffer faster</title>
<updated>2024-09-04T12:52:55+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2024-09-04T10:38:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a3f589640fd443deea230c27efd6bdfc92f5817f'/>
<id>a3f589640fd443deea230c27efd6bdfc92f5817f</id>
<content type='text'>
Use a classic doubling of capacity rather than only adding
twice as much capacity as is already known to be needed.

```
compare-ruby: ruby 3.4.0dev (2024-09-04T09:21:53Z opt-strftime-2 ae98d19cf9) +YJIT [arm64-darwin23]
built-ruby: ruby 3.4.0dev (2024-09-04T11:46:02Z opt-strftime-growth 586263d6fb) +YJIT [arm64-darwin23]
warming up...

|                            |compare-ruby|built-ruby|
|:---------------------------|-----------:|---------:|
|time.strftime("%FT%T")      |      1.754M|    1.889M|
|                            |           -|     1.08x|
|time.strftime("%FT%T.%3N")  |      1.508M|    1.749M|
|                            |           -|     1.16x|
|time.strftime("%FT%T.%6N")  |      1.488M|    1.756M|
|                            |           -|     1.18x|
compare-ruby: ruby 3.4.0dev (2024-09-04T09:21:53Z opt-strftime-2 ae98d19cf9) +YJIT [arm64-darwin23]
built-ruby: ruby 3.4.0dev (2024-09-04T09:21:53Z opt-strftime-2 ae98d19cf9) +YJIT [arm64-darwin23]
warming up...
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use a classic doubling of capacity rather than only adding
twice as much capacity as is already known to be needed.

```
compare-ruby: ruby 3.4.0dev (2024-09-04T09:21:53Z opt-strftime-2 ae98d19cf9) +YJIT [arm64-darwin23]
built-ruby: ruby 3.4.0dev (2024-09-04T11:46:02Z opt-strftime-growth 586263d6fb) +YJIT [arm64-darwin23]
warming up...

|                            |compare-ruby|built-ruby|
|:---------------------------|-----------:|---------:|
|time.strftime("%FT%T")      |      1.754M|    1.889M|
|                            |           -|     1.08x|
|time.strftime("%FT%T.%3N")  |      1.508M|    1.749M|
|                            |           -|     1.16x|
|time.strftime("%FT%T.%6N")  |      1.488M|    1.756M|
|                            |           -|     1.18x|
compare-ruby: ruby 3.4.0dev (2024-09-04T09:21:53Z opt-strftime-2 ae98d19cf9) +YJIT [arm64-darwin23]
built-ruby: ruby 3.4.0dev (2024-09-04T09:21:53Z opt-strftime-2 ae98d19cf9) +YJIT [arm64-darwin23]
warming up...
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce encoding check macro</title>
<updated>2022-12-01T16:31:27+00:00</updated>
<author>
<name>S-H-GAMELINKS</name>
<email>gamelinks007@gmail.com</email>
</author>
<published>2022-11-15T04:21:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1a64d45c67feed7355d6b53746801acb319394a4'/>
<id>1a64d45c67feed7355d6b53746801acb319394a4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Using RB_BIGNUM_TYPE_P macro</title>
<updated>2021-09-11T00:13:24+00:00</updated>
<author>
<name>S-H-GAMELINKS</name>
<email>gamelinks007@gmail.com</email>
</author>
<published>2021-09-03T11:50:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=032534dbdf08c0912dffa482e29a491b8aa9276c'/>
<id>032534dbdf08c0912dffa482e29a491b8aa9276c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Moved exported symbols in internal/util.h to ruby/util.h</title>
<updated>2021-08-24T01:37:41+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-07-28T07:40:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c38c2d8ee26c70300e2e0a4eec867273a8520579'/>
<id>c38c2d8ee26c70300e2e0a4eec867273a8520579</id>
<content type='text'>
[Feature #18051]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #18051]
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix -Wundef warnings for patterns `#if HAVE`</title>
<updated>2021-05-04T12:56:55+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2021-04-29T13:12:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0764d323d8908c1682f3ab654c48783438a88a54'/>
<id>0764d323d8908c1682f3ab654c48783438a88a54</id>
<content type='text'>
* See [Feature #17752]
* Using this to detect them:
  git grep -P 'if\s+HAVE' | grep -Pv 'HAVE_LONG_LONG|/ChangeLog|HAVE_TYPEOF'
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* See [Feature #17752]
* Using this to detect them:
  git grep -P 'if\s+HAVE' | grep -Pv 'HAVE_LONG_LONG|/ChangeLog|HAVE_TYPEOF'
</pre>
</div>
</content>
</entry>
<entry>
<title>Silence GCC 11 warnings</title>
<updated>2021-04-30T11:56:16+00:00</updated>
<author>
<name>xtkoba</name>
<email>69125751+xtkoba@users.noreply.github.com</email>
</author>
<published>2021-04-30T01:09:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1f255adda93bd7958afc7405026326f630ba4748'/>
<id>1f255adda93bd7958afc7405026326f630ba4748</id>
<content type='text'>
```
../strftime.c: In function 'rb_strftime_with_timespec':
../strftime.c:392:39: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  392 |                         if (vtm-&gt;wday &lt; 0 || vtm-&gt;wday &gt; 6)
      |                                       ^
../strftime.c:403:39: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  403 |                         if (vtm-&gt;wday &lt; 0 || vtm-&gt;wday &gt; 6)
      |                                       ^
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
../strftime.c: In function 'rb_strftime_with_timespec':
../strftime.c:392:39: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  392 |                         if (vtm-&gt;wday &lt; 0 || vtm-&gt;wday &gt; 6)
      |                                       ^
../strftime.c:403:39: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  403 |                         if (vtm-&gt;wday &lt; 0 || vtm-&gt;wday &gt; 6)
      |                                       ^
```</pre>
</div>
</content>
</entry>
<entry>
<title>UTC zone should be still "+00:00" [Feature #17544]</title>
<updated>2021-02-16T11:34:23+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-02-16T10:28:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5b7439bb7b1088ef5233175893229970cee339fd'/>
<id>5b7439bb7b1088ef5233175893229970cee339fd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>strftime.c: support unknown offset UTC in RFC 3339 [Feature #17544]</title>
<updated>2021-02-16T11:34:23+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-01-15T08:19:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9ef66ce3fcfee06d628b611dbc22026d7cc72d0e'/>
<id>9ef66ce3fcfee06d628b611dbc22026d7cc72d0e</id>
<content type='text'>
In RFC 3339, -00:00 is used for the time in UTC is known, but the
offset to local time is unknown.  Support that representation by
`-` flag for `z`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In RFC 3339, -00:00 is used for the time in UTC is known, but the
offset to local time is unknown.  Support that representation by
`-` flag for `z`.
</pre>
</div>
</content>
</entry>
</feed>
