ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#java

  1. * stfstfm joined #java
  2. * vincere1 joined #java
  3. * Ragnor joined #java
  4. * acidsys joined #java
  5. * five618480339176 joined #java
  6. * fgarcia joined #java
  7. * kathadris joined #java
  8. * henbruas joined #java
  9. * MonsterAbyss joined #java
  10. * m4 joined #java
  11. * marcel joined #java
  12. * Pixi` joined #java
  13. * magla joined #java
  14. * Etoxiuq joined #java
  15. * Bahhumbug_ joined #java
  16. * Bahhumbug joined #java
  17. * stfstfm_ joined #java
  18. * tomboy64 joined #java
  19. * pebble joined #java
  20. * leppard joined #java
  21. * MikeBux joined #java
  22. * acidjnk joined #java
  23. * michele2 joined #java
  24. * fgarcia joined #java
  25. * [X-Scale] joined #java
  26. * X-Scale joined #java
  27. * Cae2 joined #java
  28. * sa02irc joined #java
  29. * Artea joined #java
  30. hassoon 'morning
  31. * nevet joined #java
  32. * CodeGeek!~codegeek@about/java/CodeGeek changed the topic to: Welcome! || Read Channel Rules at https://javachannel.org/ before participating. || Paste limit is two lines; ~pastebin lists options. || No applets, please. || Minecraft, Android, and Javascript all have their own channel. || You are being logged.
  33. * Fiji_ joined #java
  34. * mixfix41 joined #java
  35. * MikeBux joined #java
  36. * Tyaku joined #java
  37. Tyaku Hello, I come here to talk about an issue, that maybe only experts from this kind of channels can help. ChatGPT/Google is not helping. We have some performance issues, when we call Singleton classes for the first time it can take a long time on some platforms. For example: `SSLContext.getInstance(TLSv1.2)` takes: 1.3s on my ARM 64 Bits Yocto board, 2.2s on a RPI 2B (ARM 32bits) with most recent raspberry pi
  38. Tyaku OS, 20ms on a ARCH64 computer. We don't arrive to identify the cause of this delay. Hotspot/Jit is enabled, if I start with -Xint, it reduce a little (like -300ms) but not really significative.
  39. Tyaku This is really impacting because when we connect to the websocket server, it takes 500ms on a computer to establish the connection (from DNS discovery to the end of TLS handshake) and 7-8 seconds on Yocto board, due to many singleton classes that are involved in the process (SSLContext, etc).
  40. dreamreal Tyaku: to some degree CPU speed is a limiting factor
  41. Para Low entropy systems need to generate enough entropy for secure instantiation for crypto stuff.
  42. Para RPi is afaik one of those, so it'll take a bit.
  43. * jamezp joined #java
  44. nimaje classes get load on first use (you wouldn't want to load all classes on the classpath to then only use five), so if the class has heavy initialisation, then you will see that then
  45. Tyaku TrustManagerFactory.getInstance("X509"): 307ms, defaultTmf.init(null): 2092ms, SSLContext.getInstance("TLSv1.2"): 968ms (in this sequence it takes less, because probably it use singleton classes that are already instanciated by something previously called).
  46. dreamreal Tyaku: yes, this is a problem. Long-running processes are your solution, to aggregate that cost out.
  47. Tyaku is the source code available somewhere just to see what it does internally ? In our Yocto plateform we use openjdk 8 https://hg.openjdk.org/aarch64-port/jdk8u is one of SRC_URI, but doesn't seems to be the java code .
  48. dreamreal aaaagh
  49. dreamreal why java 8
  50. dreamreal which pi are you deploying to
  51. Tyaku This is what is available in meta-java scarthgap Yocto. On a custom board, the PI was just for testing performance, but on the PI I used JRE 25
  52. Tyaku On the Yocto board RZG2UL custom board, we use meta-java (scarthgap branch), which use openjdk 8. In RPI 2B (because I had only this in my hands) I used openjdk-jre-25 because 8 was not available. But on RPI 2B this it ARM32 and not 64bits, And takes 2.2s instead of 1.3s on the Yocto board and 20ms on ubuntu computer.
  53. dreamreal yeah, raspi2 is a POS :(
  54. dreamreal sorry, you might be stuck
  55. dreamreal broadcom chips on the raspi2 are... not great
  56. Tyaku The RPI is not used to run my program, I used it just for performances tests, Here you can see the softwares that I used to do my performances tests : https://pastebin.com/ggty7xBf and some example of results
  57. Tyaku First call - Yocto Board:
  58. Tyaku WebSocketManagerImpl : Stage 'webSocket = new WebSocketClientImpl(uri)' : +342 ms
  59. Tyaku WebSocketManagerImpl : Stage 'webSocket.setSocketFactory(getSslSocketFactory(config))' : +3412 ms (SSLContext.getInstance(), defaultTmf.init() ..)
  60. Tyaku WebSocketManagerImpl : Stage 'onConnected()' : +3592 ms
  61. Tyaku First call - PC Ubuntu:
  62. Tyaku WebSocketManagerImpl : Stage 'webSocket = new WebSocketClientImpl(uri)' : +9 ms
  63. Tyaku WebSocketManagerImpl : Stage 'webSocket.setSocketFactory(getSslSocketFactory(config))' : +75 ms
  64. Tyaku WebSocketManagerImpl : Stage 'onConnected()' : +271 ms
  65. dreamreal please don't paste a lot into #java
  66. dreamreal and yes, we're saying this is pretty normal
  67. Tyaku Can we expect to increase these performances somehow ? Is it just, an issue with "entropy initialisation" ? Maybe it's not as simple as this. Here there is a discussion where they say that java does not use "HW acceleration" is that true ? https://stackoverflow.com/questions/42417183/100times-performance-slowdown-when-using-javax-net-ssl-sslsocket
  68. dreamreal Tyaku: from 9 years ago, eh
  69. dreamreal I mean, you ARE using java 8...
  70. dreamreal as far as "does it use..." it depends quite heavily on specifics
  71. * kelt0m joined #java
  72. * Cae2 joined #java
  73. * caryhartline joined #java
  74. * stfstfm joined #java
  75. * sonOfRa joined #java
  76. * stfstfm_ joined #java
  77. * stfstfm__9745 joined #java
  78. * ferdna joined #java
  79. * Ragnor joined #java
  80. * monkeyPlus joined #java
  81. * hugdru joined #java
  82. * hugdru joined #java
  83. * hugdru joined #java
  84. * hugdru joined #java
  85. * hugdru joined #java
  86. * hugdru joined #java
  87. * kathadris joined #java
  88. * hugdru joined #java
  89. * metalmaniac joined #java
  90. * hugdru joined #java
  91. * marcel joined #java
  92. * Fiji joined #java
  93. * soulofset joined #java
  94. * Fiji_ joined #java
  95. * raj joined #java