google-code-export / morphia

Automatically exported from code.google.com/p/morphia
1 stars 0 forks source link

getKeysByRefs endsless loop in ArrayList.contains? #299

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What version are you using? Morphia 1.00 r1740 with Mongo 1.8.2

I've attached a debug output from JProfiler (image and HTML). This happens 
while loading an object from Mongo with about 20k references in a set 
"children":

@Entity
public class Topic {

  public static final Log log = LogFactory.getLog(Topic.class);

  @Id
  private ObjectId id = new ObjectId();

  @Reference(lazy = true)
  @Indexed
  public Topic parent;

  @Reference(lazy = true, ignoreMissing = true)
  private Set<Topic> children = new HashSet<Topic>();

....

}

I understand that 20k is quite a lot and should take a while,  but I don't 
understand how 718 invocations of ArrayList.contains can lead to 6.7M 
invocations of Key.equals. Any ideas what is going on?

Original issue reported on code.google.com by heaths.h...@gmail.com on 7 Jul 2011 at 5:03

Attachments:

GoogleCodeExporter commented 9 years ago
Btw, I have proxytoys-1.0 and cglib-nodep-2.2 in the path

Original comment by heaths.h...@gmail.com on 7 Jul 2011 at 5:08