-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
bring back id table algorithm instead of std table [backport:2.2] #24930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Conversation
Bootstrap time for github CI for ubuntu goes from an average of 9 seconds to 8.3 seconds with this. Attempting to adapt #23403 to the 2.0 branch in #24931 raised the bootstrap time from an average of 7 seconds to 7.5. Although the time in github CI is not completely reliable to tell any performance difference, it is consistent enough that this is a real impact. Probably not the entire cause of #24929 though. I would not have thought ID tables could affect the compiler's performance so much, in generics/macro heavy code the benefit is probably larger. My guess for why it has such a big impact is calls to magics or other very commonly called routines which have implicit generic parameters, i.e. |
a thing to keep in mind is that the compiler bootstrap is a very poor benchmark - it stresses only a small part of the compiler (ie a project like nimbus has a lot more generics / macros / overloads etc to deal with). If you need a bigger test, you can use nimbus-eth2 like so: git clone https://github.com/status-im/nimbus-eth2.git
cd nimbus-eth2
make # build deps
./env.sh my_test_nim c beacon_chain/nimbus_beacon_node |
In any case this is the cause of a performance regression, we could also see its effect on nimbus after the fact, but I'll try it on github CI on version-2-2 |
Here are the results on my machine: Nim 2.2.4:
Nim 2.2.5 with the changes from this PR applied to it:
Over 20% improvement! Nice!! |
That is 29.8%, the difference in #24929 is 33.1%, for |
As tested in #24935 the performance for nimbus does not go back to 2.0 levels but still noticeably improves with this PR. |
refs #24929, partially reverts #23403
Instead of using
Table[ItemId, T]
, the old algorithm is brought back intoTIdTable[T]
to prevent a performance regression. The inheritance removal from #23403 still holds, onlyItemId
s are stored.