You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "rajat315315 (via GitHub)" <gi...@apache.org> on 2026/07/01 16:56:29 UTC

[PR] Refactor toStringEscaped method for improved efficiency and clarity [lucene]

rajat315315 opened a new pull request, #16323:
URL: https://github.com/apache/lucene/pull/16323

   ### Description
   
   <!--
   If this is your first contribution to Lucene, please make sure you have reviewed the contribution guide.
   https://github.com/apache/lucene/blob/main/CONTRIBUTING.md
   -->
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Refactor toStringEscaped method for improved efficiency and clarity [lucene]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16323:
URL: https://github.com/apache/lucene/pull/16323#issuecomment-5028866998

   This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Refactor toStringEscaped method for improved efficiency and clarity [lucene]

Posted by "neoremind (via GitHub)" <gi...@apache.org>.
neoremind commented on PR #16323:
URL: https://github.com/apache/lucene/pull/16323#issuecomment-4861689260

   Thanks for the PR! A bit thoughts purely on performance.
   
   Searching code, the only caller passes wildcardChars = `{'*', '?'}`, just 2 chars. The current impl's inner loop is as tight as iterating two chars, which I think JIT can unroll. The additional `BitSet(1 << 16)` allocates as large as 8KB array for each invocation with usually short query terms input in realworld, and the array is super sparse, we may need to weight the cost of such relatively large memory allocation vs. tight loop over small num of chars working on top of short inputs with a micro benchmark. I guess the the BitSet approach might not be as good as predicted. 
   
   Also if this method is not in critical call path, it would be better to remove the TODO comment as the current impl is clean and simple.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Refactor toStringEscaped method for improved efficiency and clarity [lucene]

Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on PR #16323:
URL: https://github.com/apache/lucene/pull/16323#issuecomment-4895764010

   I agree with @neoremind 's assessment. It looks like an improvement but the extra memory allocation may kill any gains. It'd require some careful benchmarks (not just microbenchmarks but full-stack benchmarks) to see the impact.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org