kotwal-itpro commented on PR #8883:
URL: https://github.com/apache/hop/pull/8883#issuecomment-6129060096

   Thanks @hansva. I checked this on JDK 21 and it does what it says. A few 
notes from a quick measurement:
   
   **Setup.** Generate rows (10 million rows, an Integer and a String field) → 
Dummy → Dummy → Dummy, run with `hop-run` on the local engine, OpenJDK 21.0.11 
on macOS (Apple M5 Max, 18 cores). I swapped only `hop-engine.jar` between main 
and this branch and alternated the runs.
   
   | | main | this PR |
   |---|---|---|
   | Pipeline duration, 5 runs | 5.18 / 5.31 / 5.90 / 5.80 / 5.67 s (avg 5.57) 
| 5.37 / 5.13 / 5.29 / 5.05 / 5.23 s (avg 5.21) |
   | System CPU, 4 runs | 1.24 to 1.40 s | 0.57 to 0.86 s |
   | User CPU, 4 runs | 20.7 to 21.5 s | 20.2 to 20.5 s |
   
   So about 6% faster wall clock and roughly half the system CPU on this 
machine for this pipeline: the 1 ns sleeps were mostly turning into extra 
syscalls. That's smaller than the 20 to 30% in #8882, which I'd guess depends 
on the OS, the core count and how often the rowsets hit the 1% / 99% 
boundaries; a pipeline with a slower consumer would probably show more. On JDK 
17 to 20 this changes nothing, since `sleep(0, 1)` already rounded up to 1 ms 
there.
   
   Two small things:
   - `core/src/test/java/org/apache/hop/core/SpillingRowSetTest.java:106` still 
says `Thread.sleep(0,1)` in a comment.
   - The PR description is still the template; a line linking JDK-8305092 would 
help whoever finds this later.
   
   I also searched for other nano-precision sleeps (`sleep(0, n)`, `sleep(0L, 
…)`, `TimeUnit.NANOSECONDS.sleep`, `LockSupport.parkNanos`) outside tests: this 
PR covers all of them.
   


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

Reply via email to