Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: One more heap optimization trick for zsh < 5.2



On May 8, 11:34am, Sebastian Gniazdowski wrote:
} Subject: One more heap optimization trick for zsh < 5.2
}
} repeat 1; do
}     list=( "${(@M)list:#(#i)*$~search_pattern*}" )
} done
} 
} I've recently found my system to be less responding to this trick.

Is $list getting larger e.g. you are accumulating more shell history
to be searched or the like?  IIRC the "repeat 1" trick caused a new
heap arena to be pushed instead of searching for free space in an
existing heap, but if $list is large enough to need multiple heap
arenas you may end up right back in the free space hunt.

} I thought that there's maybe an even better way
} to change how heap works for given operation?

If the size of $list is indeed the deciding factor here, I would
suspect that you're now running into heap management during the
pattern match against $~search_pattern, and there's really nothing
at the level of shell coding that can change pattern match behavior.

But all of that is speculation.



Messages sorted by: Reverse Date, Date, Thread, Author