204 words

Slow performance on Mac

#1
2017-06-03 04:50

- This code is tested on Windows and Mac. Windows is working great, Mac is very slow (read is 11 seconds on Mac, and 100 milliseconds on Windows).

- Application is using Spring Boot console application (for JPA implementation)

- MacOS Sierra 10.12.3, Core i7 CPU, 16GB RAM, SSD drive
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

 

Running sample jar:

- To generate data (write):

    java -jar demo-0.0.1-SNAPSHOT.jar write /path/to/file.odb

- To read data (write):

    java -jar demo-0.0.1-SNAPSHOT.jar read /path/to/file.odb

 

Attached:

- JAR file

- Source code

- Netbeans profiler traces (seems issue in createEntityManager() performance)

duskov
duskov's picture
Joined on 2017-06-02
User Post #2
#2
2017-06-03 06:38

Please ignore. This was Mac / Java issue related to lookupAllHostAddr

Ref: https://thoeni.io/post/macos-sierra-java/

duskov
duskov's picture
Joined on 2017-06-02
User Post #3
#3
2017-10-10 07:24

Thank you very much for this post! I am on OSX 10.12.6, JVM 1.8.0_144-b01, and I was also having performance issues on one of my development machines. On one machine my test scenario would take <1s and on a machine with similar hardware it took multiple minutes.

Although it's not ObjectDB's fault, I also traced the issue down to the "createEntityManager()" method, which would take 5 seconds. Also the ObjectDB explorer behaved weirdly and would hang for ~20 seconds when opening a database file. Very weird issue and hard to debug!

Your solution works great and saved me a lot of time. Thanks!

rroels
rroels's picture
Joined on 2017-08-10
User Post #4

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel