From issues-return-4027-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Thu Nov 7 22:55:48 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 02E37180630 for ; Thu, 7 Nov 2019 23:55:47 +0100 (CET) Received: (qmail 32283 invoked by uid 500); 7 Nov 2019 22:55:47 -0000 Mailing-List: contact issues-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list issues@lucene.apache.org Received: (qmail 32274 invoked by uid 99); 7 Nov 2019 22:55:47 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Nov 2019 22:55:47 +0000 From: GitBox To: issues@lucene.apache.org Subject: [GitHub] [lucene-solr] jpountz commented on a change in pull request #940: LUCENE-9002: Query caching leads to absurdly slow queries Message-ID: <157316734722.955.3019243784057120146.gitbox@gitbox.apache.org> Date: Thu, 07 Nov 2019 22:55:47 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit jpountz commented on a change in pull request #940: LUCENE-9002: Query caching leads to absurdly slow queries URL: https://github.com/apache/lucene-solr/pull/940#discussion_r343917507 ########## File path: lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java ########## @@ -114,12 +115,20 @@ * Expert: Create a new instance that will cache at most maxSize * queries with at most maxRamBytesUsed bytes of memory, only on * leaves that satisfy {@code leavesToCache}. + * + * Also, clauses whose cost is {@code skipCacheFactor} times more than the cost of the top-level query + * will not be cached in order to not slow down queries too much. */ public LRUQueryCache(int maxSize, long maxRamBytesUsed, - Predicate leavesToCache) { + Predicate leavesToCache, float skipCacheFactor) { this.maxSize = maxSize; this.maxRamBytesUsed = maxRamBytesUsed; this.leavesToCache = leavesToCache; + if (skipCacheFactor < 1) { Review comment: ```suggestion if (skipCacheFactor >= 1 == false) { // NaN >= 1 evaluates true ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org For additional commands, e-mail: issues-help@lucene.apache.org