directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <>
Subject [jira] [Commented] (DIRSTUDIO-1027) The LdifEditor parser is extremelly inefficient.
Date Wed, 18 Mar 2015 17:14:38 GMT


Emmanuel Lecharny commented on DIRSTUDIO-1027:

Correction : the culprit is the {{LdifScanner}} class.

FTR, I tried loading a file which is 1Mb big, with 1670 entries : we do 278 459 {{arrayCopy}}
calls. Suppressing one single attribute from the file results in 163 {{arrayCopy}} calls.

One of the other problem is that it put a lot of stress on the GC, as all the copied {{char[]}}
will have to be garbage collected at some point.

> The LdifEditor parser is extremelly inefficient.
> ------------------------------------------------
>                 Key: DIRSTUDIO-1027
>                 URL:
>             Project: Directory Studio
>          Issue Type: Improvement
>    Affects Versions: 2.0.0-M8 (2.0.0.v20130628)
>            Reporter: Emmanuel Lecharny
>             Fix For: 2.0.0-M9
> Processing huge LDIF file is likely to take an enormous amount of time. The parser works
in a way that we frequently fetch a char from a {{StringBuffer}}, to remove it later. When
you have a 1Mb file, that induces the copy of a 1Mb array every time we don't need the char
we just read.
> Typically, parsing a 1 237 chars file,  the {{noRead()}} method is called 393 times,
and it calls the {{System.arrayCopy()}} the same number of time.

This message was sent by Atlassian JIRA

View raw message