You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5555 Reporter: Christoph Bauer Assigned to:@lefessan Status: closed (set by @xavierleroy on 2015-12-11T18:04:51Z) Resolution: fixed Priority: normal Severity: minor Version: 3.12.1 Fixed in version: 4.00.0+dev Category: standard library Monitored by:@rixed mehdi "Julien Signoles" @yakobowski
Bug description
The internal bucket array of an hashtable grows in Hashtbl.add/replace,
but neither Hashtbl.remove nor Hashtbl.clear shrink the table.
The text was updated successfully, but these errors were encountered:
True, it's not resizing, it is clearing and resetting to the initial size. Users should only use it if they need to recover some space, otherwise, they probably want to keep the current size and just clear all entries.
Oh, reading your comment then the actual diff I realize that reset also clears the hashtbl.
I then respectfully disagree with closing this ticket, then.
That's very nice to have both clear and reset behavior (but I'd favor to add an optional boolean argument to clear that would additionnally shrinks the hash size).
It seams to me that the initial concern was that when using long lived hashtables which sizes may vary in great proportion then the overall size of all hashtable growth continuously, which hurts memory and thus performances.
I understand that shrinking dynamically a hash is a tedious topic (one must avoid to continuously grow/shrink), though.
Original bug ID: 5555
Reporter: Christoph Bauer
Assigned to: @lefessan
Status: closed (set by @xavierleroy on 2015-12-11T18:04:51Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.12.1
Fixed in version: 4.00.0+dev
Category: standard library
Monitored by: @rixed mehdi "Julien Signoles" @yakobowski
Bug description
The internal bucket array of an hashtable grows in Hashtbl.add/replace,
but neither Hashtbl.remove nor Hashtbl.clear shrink the table.
The text was updated successfully, but these errors were encountered: