You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we want to reduce the binary size/compilation time, then I could think of two ideas:
First, split the target and TargetInfo into two arrays, this would help simplify the array, and might make binary search faster as more target can be in the cache.
For TargetInfo, we can store the string inline.
We can internalise the string into a one big &str and refer to it via index, we can simply use a u16 for base pointer.
The simplest impl is to use HashSet in gen-target-info to dedup them, and then concat them into one giant string, each terminated by \0 and assign them each a u16 based on the length within the giant string.
That will compress 16B &'static str on 64-bit platform to 2B, and should improve compile-time as well.
Though it looks like something out of scope for this ticket.
First, split the target and
TargetInfo
into two arrays, this would help simplify the array, and might make binary search faster as more target can be in the cache.For
TargetInfo
, we can store the string inline.We can internalise the string into a one big
&str
and refer to it via index, we can simply use au16
for base pointer.The simplest impl is to use
HashSet
in gen-target-info to dedup them, and then concat them into one giant string, each terminated by\0
and assign them each au16
based on the length within the giant string.That will compress 16B
&'static str
on 64-bit platform to 2B, and should improve compile-time as well.Though it looks like something out of scope for this ticket.
Originally posted by @NobodyXu in #1266 (comment)
The text was updated successfully, but these errors were encountered: