تو مستندات آموزش rust قبل از اینکه ownership رو توضیح بده در مورد heap و stack صحبت کرده، توضیح کوتاه و خوبیه، یادآوری خوبی میتونه باشه
https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html
چقدر این مثالش قشنگه برای اینکه چرا دسترسی به heap کندتر از stack هست
Accessing data in the heap is slower than accessing data on the stack because you have to follow a pointer to get there. Contemporary processors are faster if they jump around less in memory. Continuing the analogy, consider a server at a restaurant taking orders from many tables. It’s most efficient to get all the orders at one table before moving on to the next table. Taking an order from table A, then an order from table B, then one from A again, and then one from B again would be a much slower process. By the same token, a processor can do its job better if it works on data that’s close to other data (as it is on the stack) rather than farther away (as it can be on the heap).
@gocasts