1 Reply Latest reply on Sep 1, 2017 7:51 AM by Wessel Nieboer

    Performance degradation when inserting many nodes

    Jacob Ilsø Newbie

      I am trying to insert thousands of nodes at a time. To begin with ModeShape performs satisfactorily but after a short time performance drastically degrades. Here is the code I run:

       

              Node rootNode = session.getRootNode();

              Node firstLevelChild = rootNode.addNode(UUID.randomUUID().toString(), "nt:folder");

       

              for (int i = 0; i < 200; i++) {

                  Node secondLevelChild = firstLevelChild.addNode(UUID.randomUUID().toString(), "nt:folder");

                  for (int j = 0; j < 200; j++) {

                      secondLevelChild.addNode(UUID.randomUUID().toString(), "nt:folder");

                  }

              }

       

              session.save();

       

      I made the code so as to avoid a large fan out which I know will cause performance issues with ModeShape.

      The first time it takes 5 seconds to run this. After running it about 10 times the execution time has increased to 1 minute. Is this expected behaviour?

       

      After a few more runs the save call fails with this:

       

      java.lang.IllegalArgumentException: Could not deserialize [-84, -19, 0, 5, 115, 114, 0, 55, 111, 114, 103, 46, 109, 111, 100, 101, 115, 104, 97, 112, 101, 46, 115, 99, 104, 101, 109, 97, 116, 105, 99, 46, 105, 110, 116, 101, 114, 110, 97, 108, 46, 100, 111, 99, 117, 109, 101, 110, 116, 46, 66, 97, 115, 105, 99, 68, 111, 99, 117, 109, 101, 110, 116, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 120, 114, 0, 23, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 76, 105, 110, 107, 101, 100, 72, 97, 115, 104, 77, 97, 112, 52, -64, 78, 92, 16, 108, -64, -5, 2, 0, 1, 90, 0, 11, 97, 99, 99, 101, 115, 115, 79, 114, 100, 101, 114, 120, 114, 0, 17, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 72, 97, 115, 104, 77, 97, 112, 5, 7, -38, -63, -61, 22, 96, -47, 3, 0, 2, 70, 0, 10, 108, 111, 97, 100, 70, 97, 99, 116, 111, 114, 73, 0, 9, 116, 104, 114, 101, 115, 104, 111, 108, 100, 120, 112, 63, 64, 0, 0, 0, 0, 0, 12, 119, 8, 0, 0, 0, 16, 0, 0, 0, 2, 116, 0, 8, 109, 101, 116, 97, 100, 97, 116, 97, 115, 113, 0, 126, 0, 0, 63, 64, 0, 0, 0, 0, 0, 12, 119, 8, 0, 0, 0, 16, 0, 0, ... [1.4.191/0]

              at org.h2.mvstore.DataUtils.newIllegalArgumentException(DataUtils.java:736)

              at org.h2.mvstore.type.ObjectDataType.deserialize(ObjectDataType.java:372)

       

      I do not have any indexes defined and I use file based persistence. I am using ModeShape 5.4.0.Final together with WildFly 10.1.0.Final on Windows 8.1.