Modify a SmallVec inline size for UseList to be slightly larger. (#93)
This PR updates the `UseList` type alias to a `SmallVec` with 4 `Use`s (which are 4 bytes each) rather than 2, because we get 16 bytes of space "for free" in a `SmallVec` on a 64-bit machine. This PR improves the compilation performance of Cranelift by 1% on SpiderMonkey.wasm (measured on a Linux desktop with pinned CPU frequency, and pinned to one core). It's worth noting also that before making these changes, I explored whether it would be possible to put the lists of uses and liveranges in single large backing `Vec`s; the basic reason why we can't do this is that during liverange construction, we append to many lists concurrently. One could use a linked-list arrangement, and in fact RA2 did this early in its development; the separate `SmallVec`s were better for performance overall because the cache locality wins when we traverse the lists many times. It may still be worth investigating use of an arena to allocate the vecs rather than the default heap allocator.
This commit is contained in:
@@ -12,7 +12,7 @@ repository = "https://github.com/bytecodealliance/regalloc2"
|
||||
|
||||
[dependencies]
|
||||
log = { version = "0.4.8", default-features = false }
|
||||
smallvec = "1.6.1"
|
||||
smallvec = { version = "1.6.1", features = ["union"] }
|
||||
fxhash = "0.2.1"
|
||||
slice-group-by = "0.3.0"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user