Qt: Allow caching columns while dissecting color

It is fine to dissect and cache columns data during color dissection if
it won't evict already cached data. There is rather high probability of
using the column data because color information is dissected in order.
This commit is contained in:
Tomasz Moń 2023-01-28 14:49:21 +01:00
parent ac64be57c0
commit 516c69b921
No known key found for this signature in database
GPG Key ID: 397DFEBE343AD96F
1 changed files with 3 additions and 2 deletions

View File

@ -54,8 +54,9 @@ void PacketListRecord::ensureColorized(capture_file *cap_file)
bool dissect_color = !colorized_ || ( color_ver_ != rows_color_ver_ );
if (dissect_color) {
/* Do not dissect columns to avoid thrashing cache */
dissect(cap_file, false, dissect_color);
/* Dissect columns only if it won't evict anything from cache */
bool dissect_columns = col_text_cache_.totalCost() < col_text_cache_.maxCost();
dissect(cap_file, dissect_columns, dissect_color);