kaivalnp commented on PR #12160:
URL: https://github.com/apache/lucene/pull/12160#issuecomment-1440817461

   I ran some benchmarks as well (Columns 2-4 are latency in ms):
   
   ### enwiki (topK = 100, segment count = 10)
   | recall | Sequential | CompletableFuture | SliceExecutor | nDoc | fanout | 
maxConn | beamWidth |
   |-|-|-|-|-|-|-|-|
   | 0.995 |  1.00 |  0.31 |  0.32 |   10000 |  0 | 16 | 32 |
   | 0.998 |  1.33 |  0.37 |  0.38 |   10000 | 50 | 16 | 32 |
   | 0.998 |  1.09 |  0.31 |  0.32 |   10000 |  0 | 16 | 64 |
   | 0.999 |  1.43 |  0.37 |  0.40 |   10000 | 50 | 16 | 64 |
   | 0.995 |  0.99 |  0.29 |  0.31 |   10000 |  0 | 32 | 32 |
   | 0.998 |  1.31 |  0.35 |  0.37 |   10000 | 50 | 32 | 32 |
   | 0.998 |  1.05 |  0.29 |  0.31 |   10000 |  0 | 32 | 64 |
   | 0.999 |  1.40 |  0.36 |  0.38 |   10000 | 50 | 32 | 64 |
   | 0.987 |  1.73 |  0.39 |  0.41 |  100000 |  0 | 16 | 32 |
   | 0.992 |  2.37 |  0.49 |  0.52 |  100000 | 50 | 16 | 32 |
   | 0.993 |  1.92 |  0.41 |  0.44 |  100000 |  0 | 16 | 64 |
   | 0.996 |  2.57 |  0.53 |  0.56 |  100000 | 50 | 16 | 64 |
   | 0.987 |  1.74 |  0.39 |  0.41 |  100000 |  0 | 32 | 32 |
   | 0.992 |  2.34 |  0.50 |  0.52 |  100000 | 50 | 32 | 32 |
   | 0.994 |  1.98 |  0.42 |  0.45 |  100000 |  0 | 32 | 64 |
   | 0.997 |  2.68 |  0.54 |  0.57 |  100000 | 50 | 32 | 64 |
   | 0.971 |  2.76 |  0.56 |  0.46 | 1000000 |  0 | 16 | 32 |
   | 0.982 |  3.75 |  0.72 |  0.60 | 1000000 | 50 | 16 | 32 |
   | 0.985 |  3.26 |  0.61 |  0.55 | 1000000 |  0 | 16 | 64 |
   | 0.991 |  4.24 |  0.80 |  0.64 | 1000000 | 50 | 16 | 64 |
   | 0.973 |  2.80 |  0.58 |  0.51 | 1000000 |  0 | 32 | 32 |
   | 0.983 |  3.88 |  0.75 |  0.62 | 1000000 | 50 | 32 | 32 |
   | 0.986 |  3.33 |  0.65 |  0.57 | 1000000 |  0 | 32 | 64 |
   | 0.992 |  4.57 |  0.85 |  0.70 | 1000000 | 50 | 32 | 64 |
   
   ### enwiki (topK = 100, segment count = 5)
   | recall | Sequential | CompletableFuture | SliceExecutor | nDoc | fanout | 
maxConn | beamWidth |
   |-|-|-|-|-|-|-|-|
   | 0.991 |  0.59 |  0.28 |  0.23 |   10000 |  0 | 16 | 32 |
   | 0.996 |  0.84 |  0.34 |  0.27 |   10000 | 50 | 16 | 32 |
   | 0.997 |  0.62 |  0.28 |  0.23 |   10000 |  0 | 16 | 64 |
   | 0.999 |  0.89 |  0.35 |  0.31 |   10000 | 50 | 16 | 64 |
   | 0.991 |  0.60 |  0.26 |  0.21 |   10000 |  0 | 32 | 32 |
   | 0.995 |  0.81 |  0.35 |  0.26 |   10000 | 50 | 32 | 32 |
   | 0.997 |  0.65 |  0.27 |  0.22 |   10000 |  0 | 32 | 64 |
   | 0.999 |  0.86 |  0.36 |  0.29 |   10000 | 50 | 32 | 64 |
   | 0.978 |  0.97 |  0.36 |  0.29 |  100000 |  0 | 16 | 32 |
   | 0.987 |  1.29 |  0.47 |  0.38 |  100000 | 50 | 16 | 32 |
   | 0.989 |  1.08 |  0.40 |  0.31 |  100000 |  0 | 16 | 64 |
   | 0.994 |  1.46 |  0.52 |  0.41 |  100000 | 50 | 16 | 64 |
   | 0.977 |  0.98 |  0.36 |  0.31 |  100000 |  0 | 32 | 32 |
   | 0.987 |  1.32 |  0.49 |  0.37 |  100000 | 50 | 32 | 32 |
   | 0.989 |  1.14 |  0.40 |  0.34 |  100000 |  0 | 32 | 64 |
   | 0.994 |  1.55 |  0.56 |  0.42 |  100000 | 50 | 32 | 64 |
   | 0.957 |  1.54 |  0.57 |  0.45 | 1000000 |  0 | 16 | 32 |
   | 0.972 |  2.07 |  0.70 |  0.60 | 1000000 | 50 | 16 | 32 |
   | 0.976 |  1.71 |  0.61 |  0.53 | 1000000 |  0 | 16 | 64 |
   | 0.985 |  2.33 |  0.76 |  0.65 | 1000000 | 50 | 16 | 64 |
   | 0.959 |  1.58 |  0.57 |  0.45 | 1000000 |  0 | 32 | 32 |
   | 0.974 |  2.17 |  0.73 |  0.63 | 1000000 | 50 | 32 | 32 |
   | 0.978 |  1.88 |  0.65 |  0.53 | 1000000 |  0 | 32 | 64 |
   | 0.987 |  2.57 |  0.83 |  0.69 | 1000000 | 50 | 32 | 64 |
   
   ### enwiki (topK = 100, segment count = 1)
   | recall | Sequential | CompletableFuture | SliceExecutor | nDoc | fanout | 
maxConn | beamWidth |
   |-|-|-|-|-|-|-|-|
   | 0.941 |  0.23 |  0.25 |  0.21 |   10000 |  0 | 16 | 32 |
   | 0.970 |  0.24 |  0.27 |  0.25 |   10000 | 50 | 16 | 32 |
   | 0.965 |  0.19 |  0.23 |  0.20 |   10000 |  0 | 16 | 64 |
   | 0.984 |  0.27 |  0.28 |  0.28 |   10000 | 50 | 16 | 64 |
   | 0.941 |  0.17 |  0.20 |  0.17 |   10000 |  0 | 32 | 32 |
   | 0.970 |  0.23 |  0.27 |  0.24 |   10000 | 50 | 32 | 32 |
   | 0.966 |  0.20 |  0.22 |  0.20 |   10000 |  0 | 32 | 64 |
   | 0.985 |  0.26 |  0.29 |  0.28 |   10000 | 50 | 32 | 64 |
   | 0.909 |  0.26 |  0.29 |  0.28 |  100000 |  0 | 16 | 32 |
   | 0.945 |  0.36 |  0.38 |  0.38 |  100000 | 50 | 16 | 32 |
   | 0.944 |  0.30 |  0.32 |  0.31 |  100000 |  0 | 16 | 64 |
   | 0.969 |  0.42 |  0.43 |  0.43 |  100000 | 50 | 16 | 64 |
   | 0.914 |  0.28 |  0.30 |  0.29 |  100000 |  0 | 32 | 32 |
   | 0.948 |  0.37 |  0.43 |  0.44 |  100000 | 50 | 32 | 32 |
   | 0.949 |  0.31 |  0.35 |  0.31 |  100000 |  0 | 32 | 64 |
   | 0.972 |  0.41 |  0.48 |  0.43 |  100000 | 50 | 32 | 64 |
   | 0.870 |  0.35 |  0.38 |  0.36 | 1000000 |  0 | 16 | 32 |
   | 0.911 |  0.48 |  0.51 |  0.50 | 1000000 | 50 | 16 | 32 |
   | 0.913 |  0.40 |  0.43 |  0.42 | 1000000 |  0 | 16 | 64 |
   | 0.945 |  0.55 |  0.59 |  0.57 | 1000000 | 50 | 16 | 64 |
   | 0.881 |  0.38 |  0.43 |  0.39 | 1000000 |  0 | 32 | 32 |
   | 0.919 |  0.52 |  0.57 |  0.55 | 1000000 | 50 | 32 | 32 |
   | 0.923 |  0.45 |  0.50 |  0.47 | 1000000 |  0 | 32 | 64 |
   | 0.954 |  0.62 |  0.67 |  0.65 | 1000000 | 50 | 32 | 64 |
   
   I used `KnnGraphTester` for this benchmark with two changes:
   - Used `elapsed` time instead of `totalCpuTime` (which measures time for 
which the main thread was running). This is important because the main thread 
may be "waiting" on executor threads to finish, and not count towards overall 
latency
   - Added an executor: 
`Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())` to 
the `IndexSearcher` object, to "make use" of concurrency
   
   Please let me know if this sounds fine?
   
   As expected, the speedup is higher for larger number of segments since they 
are taken up in parallel. I have also tried to measure the overhead of 
searching from a single segment


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to