<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Balz<br>
    <br>
    Am 26.04.12 17:32, schrieb basZero:
    <blockquote
cite="mid:CAOXzDSE2hWKDw3U3419gs2oxLDY+m0hNj8h_g6MSZD_fh3fR6g@mail.gmail.com"
      type="cite">Hi,
      <div><br>
      </div>
      <div>I have noticed very poor performance (over 5 seconds) when
        using</div>
      <div>group = YarepGroupManager.getGroup(groupid)</div>
      <div><br>
      </div>
      <div>and above all </div>
      <div>group.addMember(userObject) (this call is very slow!)</div>
      <div><br>
      </div>
      <div>when having thousands of users.</div>
      <div><br>
      </div>
      <div>1) YarepGroupManager.getGroup(groupid)</div>
      <div><br>
      </div>
      <div>When looking at the code of getGroup(), it loops over ALL
        users and</div>
      <div>verifies whether the user really exists and only adds it when
        it exists.</div>
      <div><br>
      </div>
      <div>From a performane point of view, I don't want the Yanel to
        verify the existance of 10'000 XMLs.</div>
      <div>Is there a way to speed this up? I would prefer the usage of
        JAXB (just converting XML to Java or the other way round). Then,
        if you really need verification of some items, you can loop over
        all items and do your logic.</div>
      <div><br>
      </div>
      <div>2) group.addMember(userObject)</div>
      <div>on my local laptop, this method took 5 seconds alone with
        1000 users.</div>
      <div><br>
      </div>
      <div>the code mainly does:</div>
      <div>- first add the group to the user XML (which should be quick,
        did not measure it yet)</div>
      <div>- secondly the user id gets added to the group XML: here also
        createConfiguration() gets called which loops over all items, I
        think this is just too slow when not using a marshalling engine
        like JAXB.</div>
      <div><br>
      </div>
      <div>What is your experience?</div>
    </blockquote>
    <br>
    I have the same experience, whereas it depends on how you use these
    classes. Also these were not built<br>
    for performance, but for functionality. Whereas this shall be no
    excuse, but just an explanation.<br>
    <br>
    I completely agree that we need to improve this with the intention
    that these implementations should scale<br>
    for millions of users and groups.<br>
    <blockquote
cite="mid:CAOXzDSE2hWKDw3U3419gs2oxLDY+m0hNj8h_g6MSZD_fh3fR6g@mail.gmail.com"
      type="cite">
      <div> What can I do?</div>
    </blockquote>
    <br>
    Do your own implementation of the group manager and configure it
    inside your realm.xml configuration, e.g.<br>
    <br>
    <ac-identities
    class="com.zwischengas.wyona.security.impl.IdentityManagerFactoryImpl"
    xmlns:zg=<a class="moz-txt-link-rfc2396E" href="http://www.zwischengas.com/wyona/security1.0.0">"http://www.zwischengas.com/wyona/security1.0.0"</a>><br>
    ...<br>
    <br>
    whereas in order to save time you might want to derive all the
    classes from Yarep which work and just overwrite<br>
    the implementations which don't scale well.<br>
    <br>
    Even better, you create a "pull branch" such that you and I can work
    together and I will be happy to help you on this,<br>
    because I also need such an implementation shortly.<br>
    <br>
    We could call it org/wyona/security/impl/yarep2<br>
    <br>
    or whatever<br>
    <br>
    WDYT?<br>
    <br>
    Thanks<br>
    <br>
    Michael<br>
    <blockquote
cite="mid:CAOXzDSE2hWKDw3U3419gs2oxLDY+m0hNj8h_g6MSZD_fh3fR6g@mail.gmail.com"
      type="cite">
      <div><br>
      </div>
      <div>Cheers</div>
      <div>
        Balz</div>
      <div title="signature"> </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
  </body>
</html>