[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lua-l
Subject:    Fun with table rehash
From:       Egor Skriptunoff <egor.skriptunoff () gmail ! com>
Date:       2020-09-30 11:23:53
Message-ID: CAPweGw58KOpFzuMKNUPjr3te_X4LsR89TGDabsv9=TbmyXMKjQ () mail ! gmail ! com
[Download RAW message or body]

Hi!

This program runs very fast:

local t = {}
-- t.slow = true
for j = 1, 1e6 do t[j], t[-j] = 0, nil end

But if you uncomment the line with the "slow" option...

[Attachment #3 (text/html)]

<div dir="ltr"><div>Hi!<br></div><div dir="ltr"><br>This program runs very \
fast:<br><br><span style="font-family:monospace">local t = {}<br>-- t.slow = \
true<br>for j = 1, 1e6 do t[j], t[-j] = 0, nil end<br></span><br>But if you uncomment \
the line with the &quot;slow&quot; option...<br><br></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic