aai-institute / aai-institute/pyDVL

Dynamically determine caching's time_threshold

オープン
#464 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement good first issue
主要言語
Python
スター
146
フォーク
10
PR マージ指標
30日以内にマージされた PR はありません

説明

But time thresholds should depend on the latency of the caching backend, shouldn't they? We definitely don't want to cache every function call to memcached and definitely not to disk, so that a 0 here is not good for the users.

The default 0.3 was a hacky way of avoiding that, agreed. Instead what we need is an estimate of the latency in the backend, and the time of computation for the wrapped function . If in the first call the latter takes longer than the latency by a factor of, say 2, then we store to cache and upon the next call, check these numbers again and retrieve from cache. Backends can define a default latency or, ideally, they can precompute it dynamically upon construction by averaging a few hundred dummy read/writes.

I think we should do this since it avoids a major potential performance issue and just takes a couple of calls to `time()`

_Originally posted by @mdbenito in https://github.com/aai-institute/pyDVL/pull/458#discussion_r1420281580_

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。