update: use buffer to cache the locals info

update: use buffer to cache the locals info