bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Limiting history size seems to be implemented inefficiently


From: Janek Warchoł
Subject: Limiting history size seems to be implemented inefficiently
Date: Sun, 11 Mar 2018 10:28:26 +0100

Hello,

I may be wrong, but from what I see in
lib/readline/history.c:stifle_history, every time stored history reaches
HISTSIZE limit, the whole array keeping history data is rewritten (by
moving each element one index further to make room for new entry. This is
quite inefficient. Shouldn't we rather have a "0th_index" variable
remembering where in the array the first element is and manipulate it?

Let me know if it's not clear what I mean and I'll elaborate.

best,
Jan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]