You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/06/08 13:49:26 UTC

[GitHub] [lucene] craigtaverner commented on a diff in pull request #946: LUCENE-10604: Add Tessellation monitor for easier debugging of triangulation algorithm

craigtaverner commented on code in PR #946:
URL: https://github.com/apache/lucene/pull/946#discussion_r892406529


##########
lucene/core/src/java/org/apache/lucene/geo/Tessellator.java:
##########
@@ -817,8 +841,12 @@ private static final boolean splitEarcut(
             sortByMortonWithReset(searchNode);
             sortByMortonWithReset(splitNode);
           }
-          earcutLinkedList(polygon, searchNode, tessellation, State.INIT, mortonOptimized);
-          earcutLinkedList(polygon, splitNode, tessellation, State.INIT, mortonOptimized);
+          notifyMonitorSplit("SPLIT[" + depth + "]", monitor, searchNode, splitNode);

Review Comment:
   Since the split function is called very infrequently (a couple of times for an entire tessellation session), I presume this object allocation is negligible (note how a few lines later we have `return true` so even though this is a while loop, it is called only once).
   
   The option of passing in the depth only and creating the string deeper in the stack will result in exactly the same number of object constructions. However, I can see the advantage of test code not creating the strings at all. Since this is called very little, it is only a tiny saving, but a saving nevertheless. I kept it as a string here mainly for symmetry with the other functions (notifyMonitor).



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