Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-1290

[Perf]Potential Speedup by returning a ref instead of a clone when asking for the RootDSE

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.5.4
    • 2.0.0-RC2
    • rootDSE
    • None

    Description

      We can speedup the server if we don't clone the rootDSE when we simply need to check for the presence of some values, like in protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java :

      DirectoryService ds = session.getCoreSession().getDirectoryService();
      PartitionNexus nexus = ds.getPartitionNexus();
      Value<?> subschemaSubentry = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
      LdapDN subschemaSubentryDn = new LdapDN( ( String ) ( subschemaSubentry.get() ) );
      subschemaSubentryDn.normalize( ds.getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
      String subschemaSubentryDnNorm = subschemaSubentryDn.getNormName();

      when we call the getRootDSE method, we get back a clone, and this is done once per search. We just need the SubschemaSubentry attribute's value here, and we won't change it.

      We could create a getRootDseRef() which returns a reference to the rootDSE object.

      Attachments

        1. rootDse.txt
          4 kB
          Emmanuel Lécharny

        Activity

          People

            Unassigned Unassigned
            elecharny Emmanuel Lécharny
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: