code logs -> 2021 -> Sat, 23 Jan 2021< code.20210122.log - code.20210124.log >
--- Log opened Sat Jan 23 00:00:42 2021
01:15 mac [macdjord@Nightstar-re5.7if.45.45.IP] has joined #code
01:15 mode/#code [+o mac] by ChanServ
01:18 macdjord|slep [macdjord@Nightstar-re5.7if.45.45.IP] has quit [Ping timeout: 121 seconds]
01:21 macdjord|slep [macdjord@Nightstar-re5.7if.45.45.IP] has joined #code
01:21 mode/#code [+o macdjord|slep] by ChanServ
01:24 mac [macdjord@Nightstar-re5.7if.45.45.IP] has quit [Ping timeout: 121 seconds]
03:00 catalyst_ [catalyst@Nightstar-ejd4sd.cable.virginm.net] has quit [Connection closed]
03:54 Degi [Degi@Nightstar-gm4ka0.dyn.telefonica.de] has quit [Operation timed out]
03:54 Degi [Degi@Nightstar-omun51.dyn.telefonica.de] has joined #code
04:24 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has quit [Connection closed]
04:24 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has joined #code
04:24 mode/#code [+ao VirusJTG VirusJTG] by ChanServ
05:03 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
05:09 Vorntastic [uid293981@Nightstar-h2b233.irccloud.com] has joined #code
05:09 mode/#code [+qo Vorntastic Vorntastic] by ChanServ
06:13 SmithKurosaki [uid215460@Nightstar-ed0oqj.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity]
06:17 celticminstrel [celticminst@Nightstar-n1gkap.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
06:44 catalyst [catalyst@Nightstar-ejd4sd.cable.virginm.net] has joined #code
07:12 abudhabi [abudhabi@Nightstar-msdsqr.adsl.tpnet.pl] has joined #code
09:41 Kindamoody[zZz] is now known as Kindamoody
09:58 Emmy [Emmy@Nightstar-l49opt.fixed.kpn.net] has joined #code
10:03 mode/#code [+o ErikMesoy] by ChanServ
10:34 Kindamoody is now known as Kindamoody|afk
13:35 john_cephalopoda [john@Nightstar-p87qss.dip0.t-ipconnect.de] has joined #code
14:48 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
14:48 mode/#code [+qo Vornicus Vornicus] by ChanServ
15:59 Vorntastic [uid293981@Nightstar-h2b233.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity]
16:19 Kizor [moryok@Nightstar-e0a4sm.utu.fi] has quit [Ping timeout: 121 seconds]
16:29 Kizor [moryok@Nightstar-e0a4sm.utu.fi] has joined #code
16:30 Kizor is now known as NSGuest42457
16:33 NSGuest42457 is now known as Kizor
16:35 Kindamoody|afk is now known as Kindamoody
17:20 Kizor [moryok@Nightstar-e0a4sm.utu.fi] has quit [Ping timeout: 121 seconds]
17:40 Kizor [moryok@Nightstar-e0a4sm.utu.fi] has joined #code
17:41 Kizor is now known as NSGuest56414
19:20 celticminstrel [celticminst@Nightstar-n1gkap.dsl.bell.ca] has joined #code
19:20 mode/#code [+o celticminstrel] by ChanServ
19:49 NSGuest56414 is now known as Kizor
20:54 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [The TLS connection was non-properly terminated.]
21:06
<&[R]>
https://i.imgur.com/EFgu8xQ.png
21:09
<@Tamber>
............
21:09
< john_cephalopoda>
It is fast.
21:10 Reiver is now known as Joe
21:10
< john_cephalopoda>
If it was done with a loop and bit shifting, it would take <number of bits> loop rounds. With that approach, the compiler will likely build a pretty jump table with O(1) access.
21:11 Kizor is now known as Shirley
21:11 Vornicus is now known as Misty
21:12
< john_cephalopoda>
The jump table is definitely the less memory-efficient solution though.
21:13
<&McMartin>
I am also going to assume that that function's text was mechanically generated.
21:13
<~Misty>
not actually faster though because the dereferences will also cost actual time
21:13
<&McMartin>
You're replacing 32 branches with one computed GOTO.
21:14
<&McMartin>
Er.
21:14
<&McMartin>
16 branches.
21:14
<&McMartin>
These days whether that is *faster* will depend on how good your branch prediction is compared to the cost of a miss in the instruction cache
21:16
< john_cephalopoda>
InstructionTable[ip](); Should be pretty fast.
21:21
< john_cephalopoda>
My naive solution for the other way would be https://bpa.st/WKNIA .
21:21
< john_cephalopoda>
Ah, damn, ip & 15 is wrong.
21:22
< john_cephalopoda>
Should be ip & 0x8000, if I am not mistaken.
21:30 abudhabi [abudhabi@Nightstar-msdsqr.adsl.tpnet.pl] has quit [NickServ (RECOVER command used by abudhabi_)]
21:30 abudhabi [abudhabi@Nightstar-cgcbhm.adsl.tpnet.pl] has joined #code
21:59 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
21:59 mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ
22:04 Shirley is now known as Allison
22:06 Allison is now known as Shirley
22:29
<~Misty>
16 branches, the instructions for each thing is 16 dereferences
22:44
< john_cephalopoda>
16 branches for which one?
22:44
< john_cephalopoda>
Ah, the loop one?
22:45
< john_cephalopoda>
Wouldn't it be 32 branches? 16 for the if/else, 16 for the condition of the for loop? (Though it should be easy to unroll.)
22:50 Pink_ [uid208117@Nightstar-h2b233.irccloud.com] has joined #code
22:50
<~Misty>
with that small a thing, yeah, I'd say unroll is reasonably likely
22:55 Emmy [Emmy@Nightstar-l49opt.fixed.kpn.net] has quit [Ping timeout: 121 seconds]
23:56
< john_cephalopoda>
Hm, I wonder if the look-up table of the other approach could be generated using a compiler macro.
--- Log closed Sun Jan 24 00:00:44 2021
code logs -> 2021 -> Sat, 23 Jan 2021< code.20210122.log - code.20210124.log >

[ Latest log file ]