Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Dec 2018 05:47:22 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r342109 - head/sys/contrib/zstd/lib/compress
Message-ID:  <201812150547.wBF5lM7J076107@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Sat Dec 15 05:47:22 2018
New Revision: 342109
URL: https://svnweb.freebsd.org/changeset/base/342109

Log:
  Revert accidentally included changes in r342108
  
  If you're curious, please follow along in https://reviews.freebsd.org/D18537 .
  
  Sorry for the noise.

Modified:
  head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h
  head/sys/contrib/zstd/lib/compress/zstd_opt.c

Modified: head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h
==============================================================================
--- head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h	Sat Dec 15 05:46:04 2018	(r342108)
+++ head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h	Sat Dec 15 05:47:22 2018	(r342109)
@@ -691,7 +691,6 @@ MEM_STATIC U32 ZSTD_window_update(ZSTD_window_t* windo
 
 /* debug functions */
 
-#if 0
 MEM_STATIC double ZSTD_fWeight(U32 rawStat)
 {
     U32 const fp_accuracy = 8;
@@ -715,7 +714,6 @@ MEM_STATIC void ZSTD_debugTable(const U32* table, U32 
                 u, table[u], ZSTD_fWeight(sum) - ZSTD_fWeight(table[u]) );
     }
 }
-#endif
 
 #if defined (__cplusplus)
 }

Modified: head/sys/contrib/zstd/lib/compress/zstd_opt.c
==============================================================================
--- head/sys/contrib/zstd/lib/compress/zstd_opt.c	Sat Dec 15 05:46:04 2018	(r342108)
+++ head/sys/contrib/zstd/lib/compress/zstd_opt.c	Sat Dec 15 05:47:22 2018	(r342109)
@@ -53,12 +53,10 @@ MEM_STATIC U32 ZSTD_fracWeight(U32 rawStat)
 }
 
 /* debugging function, @return price in bytes */
-#if 0
 MEM_STATIC double ZSTD_fCost(U32 price)
 {
     return (double)price / (BITCOST_MULTIPLIER*8);
 }
-#endif
 
 static void ZSTD_setBasePrices(optState_t* optPtr, int optLevel)
 {
@@ -854,10 +852,8 @@ ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms,
                     for ( ; pos <= end ; pos++ ) {
                         U32 const matchPrice = ZSTD_getMatchPrice(offset, pos, optStatePtr, optLevel);
                         U32 const sequencePrice = literalsPrice + matchPrice;
-#if 0
                         DEBUGLOG(7, "rPos:%u => set initial price : %.2f",
                                     pos, ZSTD_fCost(sequencePrice));
-#endif
                         opt[pos].mlen = pos;
                         opt[pos].off = offset;
                         opt[pos].litlen = litlen;
@@ -883,22 +879,18 @@ ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms,
                                 - ZSTD_litLengthPrice(litlen-1, optStatePtr, optLevel);
                 assert(price < 1000000000); /* overflow check */
                 if (price <= opt[cur].price) {
-#if 0
                     DEBUGLOG(7, "cPos:%zi==rPos:%u : better price (%.2f<=%.2f) using literal (ll==%u) (hist:%u,%u,%u)",
                                 inr-istart, cur, ZSTD_fCost(price), ZSTD_fCost(opt[cur].price), litlen,
                                 opt[cur-1].rep[0], opt[cur-1].rep[1], opt[cur-1].rep[2]);
-#endif
                     opt[cur].mlen = 0;
                     opt[cur].off = 0;
                     opt[cur].litlen = litlen;
                     opt[cur].price = price;
                     memcpy(opt[cur].rep, opt[cur-1].rep, sizeof(opt[cur].rep));
                 } else {
-#if 0
                     DEBUGLOG(7, "cPos:%zi==rPos:%u : literal would cost more (%.2f>%.2f) (hist:%u,%u,%u)",
                                 inr-istart, cur, ZSTD_fCost(price), ZSTD_fCost(opt[cur].price),
                                 opt[cur].rep[0], opt[cur].rep[1], opt[cur].rep[2]);
-#endif
                 }
             }
 
@@ -955,10 +947,8 @@ ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms,
                         int const price = basePrice + ZSTD_getMatchPrice(offset, mlen, optStatePtr, optLevel);
 
                         if ((pos > last_pos) || (price < opt[pos].price)) {
-#if 0
                             DEBUGLOG(7, "rPos:%u (ml=%2u) => new better price (%.2f<%.2f)",
                                         pos, mlen, ZSTD_fCost(price), ZSTD_fCost(opt[pos].price));
-#endif
                             while (last_pos < pos) { opt[last_pos+1].price = ZSTD_MAX_PRICE; last_pos++; }   /* fill empty positions */
                             opt[pos].mlen = mlen;
                             opt[pos].off = offset;
@@ -967,10 +957,8 @@ ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms,
                             ZSTD_STATIC_ASSERT(sizeof(opt[pos].rep) == sizeof(repHistory));
                             memcpy(opt[pos].rep, &repHistory, sizeof(repHistory));
                         } else {
-#if 0
                             DEBUGLOG(7, "rPos:%u (ml=%2u) => new price is worse (%.2f>=%.2f)",
                                         pos, mlen, ZSTD_fCost(price), ZSTD_fCost(opt[pos].price));
-#endif
                             if (optLevel==0) break;  /* early update abort; gets ~+10% speed for about -0.01 ratio loss */
                         }
             }   }   }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812150547.wBF5lM7J076107>