00:01
jenrzzz_ has joined #ruby
00:24
Vonter has quit [Ping timeout: 260 seconds]
00:24
Vonter has joined #ruby
00:40
crespire has quit [Remote host closed the connection]
00:43
crespire has joined #ruby
01:05
jenrzzz_ has quit [Ping timeout: 260 seconds]
01:21
nirvdrum has quit [Quit: nirvdrum]
01:29
crespire has quit [Killed (NickServ (GHOST command used by crespire1!crespire@user/crespire))]
01:29
crespire1 has joined #ruby
01:31
jenrzzz_ has joined #ruby
01:39
jenrzzz_ has quit [Ping timeout: 272 seconds]
01:40
crespire has joined #ruby
01:44
crespire1 has quit [Ping timeout: 264 seconds]
01:44
desnudopenguino1 has joined #ruby
01:46
desnudopenguino has quit [Ping timeout: 245 seconds]
01:46
desnudopenguino1 is now known as desnudopenguino
01:56
cek has quit [Quit: Connection closed for inactivity]
02:13
jenrzzz_ has joined #ruby
02:21
Guest17 has joined #ruby
02:27
Guest17 has quit [Ping timeout: 272 seconds]
02:28
jenrzzz_ has quit [Ping timeout: 260 seconds]
02:31
jenrzzz_ has joined #ruby
02:37
jenrzzz_ has quit [Ping timeout: 255 seconds]
02:55
Guest17 has joined #ruby
02:58
jenrzzz_ has joined #ruby
02:59
Guest17 has quit [Ping timeout: 256 seconds]
03:03
jenrzzz_ has quit [Ping timeout: 264 seconds]
03:22
jenrzzz_ has joined #ruby
03:29
jenrzzz_ has quit [Ping timeout: 268 seconds]
03:33
Guest17 has joined #ruby
03:37
jas-maelstrom has quit [Remote host closed the connection]
03:38
Guest17 has quit [Ping timeout: 268 seconds]
03:58
rvalue has quit [Read error: Connection reset by peer]
03:59
rvalue has joined #ruby
04:11
Guest17 has joined #ruby
04:14
gaussianblue has joined #ruby
04:16
Guest17 has quit [Ping timeout: 260 seconds]
04:33
gaussianblue has quit [Quit: leaving]
04:34
grenierm has joined #ruby
04:39
havenwood has joined #ruby
04:41
jas-maelstrom has joined #ruby
05:19
gr33n7007h has quit [Ping timeout: 255 seconds]
05:27
Vonter has quit [Ping timeout: 255 seconds]
05:29
Vonter has joined #ruby
05:42
Guest17 has joined #ruby
05:42
Vonter has quit [Ping timeout: 264 seconds]
05:44
Vonter has joined #ruby
05:47
Guest17 has quit [Ping timeout: 252 seconds]
05:49
jenrzzz_ has joined #ruby
05:58
Guest17 has joined #ruby
06:03
Guest17 has quit [Ping timeout: 256 seconds]
06:04
rvalue has quit [Ping timeout: 252 seconds]
06:10
jenrzzz_ has quit [Ping timeout: 264 seconds]
06:11
rvalue has joined #ruby
06:14
Guest17 has joined #ruby
06:15
gr33n7007h has joined #ruby
06:19
Guest17 has quit [Ping timeout: 260 seconds]
06:30
Guest17 has joined #ruby
06:35
Guest17 has quit [Ping timeout: 268 seconds]
07:14
_ht has joined #ruby
07:18
Vonter has quit [Ping timeout: 264 seconds]
07:23
Guest17 has joined #ruby
07:23
Vonter has joined #ruby
07:28
Guest17 has quit [Ping timeout: 264 seconds]
07:29
gaussianblue has joined #ruby
07:42
Guest17 has joined #ruby
07:54
Guest17 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
07:56
Guest17 has joined #ruby
08:19
gaussianblue has quit [Quit: leaving]
08:23
infinityfye has joined #ruby
08:32
Guest17 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
09:20
jenrzzz_ has joined #ruby
09:25
jenrzzz_ has quit [Ping timeout: 264 seconds]
09:41
Guest17 has joined #ruby
09:42
pusewicz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
10:03
infinityfye has quit [Read error: Connection reset by peer]
10:03
infinityfye has joined #ruby
10:04
Guest17 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
10:14
grenierm has quit [Ping timeout: 250 seconds]
10:34
gaussianblue has joined #ruby
10:37
jenrzzz_ has joined #ruby
10:42
jenrzzz_ has quit [Ping timeout: 240 seconds]
11:01
emilknievel has quit [Remote host closed the connection]
11:03
donofrio_ has joined #ruby
11:06
donofrio has quit [Ping timeout: 264 seconds]
11:50
jenrzzz_ has joined #ruby
11:55
jenrzzz_ has quit [Ping timeout: 264 seconds]
12:02
jenrzzz_ has joined #ruby
12:15
jenrzzz_ has quit [Ping timeout: 246 seconds]
12:16
jenrzzz_ has joined #ruby
12:26
jenrzzz_ has quit [Ping timeout: 264 seconds]
12:31
jenrzzz_ has joined #ruby
12:38
ht_ has joined #ruby
12:40
_ht has quit [Ping timeout: 252 seconds]
12:40
ht_ is now known as _ht
12:48
jenrzzz_ has quit [Ping timeout: 260 seconds]
12:50
osc4rpt has quit [Ping timeout: 256 seconds]
12:51
osc4rpt has joined #ruby
12:58
jenrzzz_ has joined #ruby
13:00
gaussianblue has quit [Quit: leaving]
13:03
jenrzzz_ has quit [Ping timeout: 268 seconds]
13:19
cek has joined #ruby
13:23
jenrzzz_ has joined #ruby
13:28
jenrzzz_ has quit [Ping timeout: 252 seconds]
13:39
jenrzzz_ has joined #ruby
13:45
jenrzzz_ has quit [Ping timeout: 260 seconds]
13:59
brokkoli_origin has quit [Ping timeout: 264 seconds]
14:06
brokkoli_origin has joined #ruby
14:16
jenrzzz_ has joined #ruby
14:16
emilknievel has joined #ruby
14:21
jenrzzz_ has quit [Ping timeout: 260 seconds]
14:21
ua_ has quit [Remote host closed the connection]
14:39
jenrzzz_ has joined #ruby
14:44
jenrzzz_ has quit [Ping timeout: 255 seconds]
14:46
gr33n7007h has quit [Quit: WeeChat 4.2.1]
14:49
gr33n7007h has joined #ruby
14:50
jenrzzz_ has joined #ruby
14:58
jenrzzz_ has quit [Ping timeout: 264 seconds]
15:16
jenrzzz_ has joined #ruby
15:22
jenrzzz_ has quit [Ping timeout: 264 seconds]
15:28
cek has quit [Quit: Connection closed for inactivity]
15:31
ua_ has joined #ruby
15:34
jenrzzz_ has joined #ruby
15:39
jenrzzz_ has quit [Ping timeout: 268 seconds]
16:02
jenrzzz_ has joined #ruby
16:10
jenrzzz_ has quit [Ping timeout: 260 seconds]
16:26
jenrzzz_ has joined #ruby
16:31
jenrzzz_ has quit [Ping timeout: 255 seconds]
16:34
Guest17 has joined #ruby
16:39
jenrzzz_ has joined #ruby
16:44
jenrzzz_ has quit [Ping timeout: 264 seconds]
16:55
Guest17 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:03
Aminda has quit [Ping timeout: 260 seconds]
17:04
Aminda has joined #ruby
17:16
ht_ has joined #ruby
17:16
jenrzzz_ has joined #ruby
17:17
_ht has quit [Ping timeout: 252 seconds]
17:17
ht_ is now known as _ht
17:20
Perflosopher has quit [Ping timeout: 255 seconds]
17:21
jenrzzz_ has quit [Ping timeout: 268 seconds]
17:24
Perflosopher has joined #ruby
17:48
___nick___ has joined #ruby
17:50
___nick___ has quit [Client Quit]
17:52
pusewicz has joined #ruby
17:53
jenrzzz_ has joined #ruby
17:53
___nick___ has joined #ruby
17:53
___nick___ has quit [Client Quit]
17:55
___nick___ has joined #ruby
17:57
jenrzzz_ has quit [Ping timeout: 255 seconds]
18:07
rvalue has quit [Ping timeout: 255 seconds]
18:11
Aminda has quit [Remote host closed the connection]
18:11
Aminda has joined #ruby
18:18
rvalue has joined #ruby
18:24
gaussianblue has joined #ruby
18:27
jenrzzz_ has joined #ruby
18:30
felipec has joined #ruby
18:30
<
felipec >
Is it normal that this is so slow?
18:31
<
felipec >
actions = Array.new(256) { [0, 0] }
18:31
<
felipec >
1_000_000.times { actions.each { |(type,index)| $x = type } }
18:32
jenrzzz_ has quit [Ping timeout: 268 seconds]
18:33
rvalue- has joined #ruby
18:34
Riviera has joined #ruby
18:34
Vonter has quit [Ping timeout: 264 seconds]
18:34
rvalue has quit [Ping timeout: 268 seconds]
18:35
Vonter has joined #ruby
18:37
rvalue- is now known as rvalue
19:07
jenrzzz_ has joined #ruby
19:13
jenrzzz_ has quit [Ping timeout: 264 seconds]
19:35
jenrzzz_ has joined #ruby
19:36
gaussianblue has quit [Quit: leaving]
19:39
<
[0x1eef] >
felipec: Equivalent to 1_000_000 * 256. So yeah, I'd expect it to take a while.
19:46
jenrzzz_ has quit [Ping timeout: 240 seconds]
19:54
<
felipec >
[0x1eef]: takes 0.2 seconds in C
19:55
<
felipec >
27 seconds in Ruby
19:55
jenrzzz_ has joined #ruby
19:55
<
[0x1eef] >
Ruby performance is nowhere near C performance.
19:57
<
felipec >
I know, but it's surprising a loop doing nothing takes a while.
19:58
<
[0x1eef] >
A loop that iterates 256 million times.
19:59
<
havenwood >
felipec: A JIT like TruffleRuby's will likely fold it away similar to an advanced compiler.
20:00
<
havenwood >
felipec: When using the reference implementation of Ruby, be sure to enable YJIT.
20:00
jenrzzz_ has quit [Ping timeout: 252 seconds]
20:01
<
havenwood >
Not doing much repeatedly can often be optimized, but microbenchmarks of this sort of often of dubious value.
20:01
<
havenwood >
/s/of/are/
20:04
<
[0x1eef] >
You can also consider dropping down to C when you hit performance bottlenecks. The Ruby C API is nice, and easy to use. It's usually a last resort though, especially for performance-type stuff.
20:07
jenrzzz_ has joined #ruby
20:12
<
felipec >
havenwood: OK, I tried with RUBY_YJIT_ENABLE=1, the loop test was reduced from 12s to 10s.
20:14
<
felipec >
But the real test was reduced from 27s to 13.
20:16
<
felipec >
[0x1eef]: that's precisely what I did: I wrote a simple linked list implementation in C and wrote Ruby bindings for it.
20:16
jenrzzz_ has quit [Ping timeout: 255 seconds]
20:17
<
[0x1eef] >
Sounds good.
20:18
<
felipec >
With YJIT enabled Ruby 3.3 takes as much time as Go.
20:20
<
[0x1eef] >
The given code appears to assign 0 to $x 256 million times so I'm not sure there's much there but I assume you are benchmarking something a bit more realisitic.
20:22
jenrzzz_ has joined #ruby
20:25
ua_ has quit [Ping timeout: 268 seconds]
20:27
jenrzzz_ has quit [Ping timeout: 255 seconds]
20:28
<
felipec >
[0x1eef]: yeah, every single one of those iterations is going to do something, for example type=1 is add a node, and type=2 is deleting a node.
20:28
ua_ has joined #ruby
20:32
jenrzzz_ has joined #ruby
20:45
jenrzzz_ has quit [Ping timeout: 268 seconds]
20:46
victori has quit [Ping timeout: 268 seconds]
20:46
vigumnov has joined #ruby
20:46
Synthead has joined #ruby
20:46
<
Synthead >
How do I create an ascii 8-bit string as a frozen constant?
20:46
<
Synthead >
READ_HEADER = "\xc5".force_encoding(Encoding::ASCII_8BIT)
20:47
<
Synthead >
`force_encoding': can't modify frozen String: "\xC5" (FrozenError)
20:47
<
Synthead >
this is what I get when attempting to do it this way
20:47
<
Synthead >
I also tried [0xc5].pack("C"), but for some reason, this creates 197 instead of "\xC5"
20:51
jenrzzz_ has joined #ruby
20:57
jenrzzz_ has quit [Ping timeout: 260 seconds]
20:58
jenrzzz_ has joined #ruby
21:04
___nick___ has quit [Ping timeout: 255 seconds]
21:04
desnudopenguino has quit [Ping timeout: 272 seconds]
21:05
jenrzzz_ has quit [Ping timeout: 272 seconds]
21:07
jenrzzz_ has joined #ruby
21:07
<
Synthead >
ah oops, it was me: [0xc5].pack("C") works just fine
21:07
Synthead has quit [Quit: Leaving]
21:14
desnudopenguino has joined #ruby
21:16
jenrzzz_ has quit [Ping timeout: 252 seconds]
21:19
_ht has quit [Remote host closed the connection]
21:22
jenrzzz_ has joined #ruby
21:27
jenrzzz_ has quit [Ping timeout: 268 seconds]
22:03
cek has joined #ruby
22:07
jenrzzz_ has joined #ruby
22:12
jenrzzz_ has quit [Ping timeout: 260 seconds]
22:22
orbyt_v10 has joined #ruby
22:32
orbyt_v10 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
22:34
brokkoli_origin has quit [Ping timeout: 252 seconds]
22:38
jenrzzz_ has joined #ruby
22:41
brokkoli_origin has joined #ruby
22:43
jenrzzz_ has quit [Ping timeout: 268 seconds]
22:50
rlima has joined #ruby
23:00
ruby[bot] has quit [Remote host closed the connection]
23:00
ruby[bot] has joined #ruby
23:00
jenrzzz_ has joined #ruby
23:01
rlima has quit [Quit: WeeChat 3.5]
23:02
donofrio__ has joined #ruby
23:06
jenrzzz_ has quit [Ping timeout: 272 seconds]
23:06
donofrio_ has quit [Ping timeout: 252 seconds]
23:23
jenrzzz_ has joined #ruby
23:29
jenrzzz_ has quit [Ping timeout: 264 seconds]
23:43
emilknievel has quit [Ping timeout: 260 seconds]