mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Updated Note Rust performance fixes (markdown)
@@ -2,28 +2,37 @@ This is a page of random performance ideas, mostly from pcwalton.
|
||||
|
||||
pcwalton:
|
||||
graydon: there are a bunch of unnecessary allocations in trans
|
||||
|
||||
pcwalton:
|
||||
I fixed a bunch of 'em but there are certainly more
|
||||
|
||||
pcwalton:
|
||||
one thing that would very much help is a SmallVector in libstd
|
||||
|
||||
pcwalton:
|
||||
fail() really needs to be a lang_item and it needs to be parameterized over ToStr
|
||||
|
||||
pcwalton:
|
||||
the idea being that if you're failing with a constant string
|
||||
|
||||
pcwalton:
|
||||
it should not call upcall_new_str_uniq() at the site of failure
|
||||
|
||||
pcwalton:
|
||||
rather it should pass a string slice (&static/str) to a function which itself copies the string
|
||||
|
||||
pcwalton:
|
||||
move the copy out of line
|
||||
|
||||
pcwalton:
|
||||
likewise fmt! generates a ton of code. most of the time the unique string it produces is not really being used, except to be written once and thrown away
|
||||
|
||||
graydon:
|
||||
mhm
|
||||
|
||||
pcwalton:
|
||||
(1) stop zeroing stuff out to revoke cleanups, use a flag instead to indicate whether the dtor needs to be run (this is potentially a quite large win)
|
||||
|
||||
pcwalton:
|
||||
(2) try to coalesce failure landing pads instead of duplicating the cleanups all the time
|
||||
|
||||
|
||||
Reference in New Issue
Block a user