[ 
https://issues.apache.org/jira/browse/HDDS-13324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Devesh Kumar Singh updated HDDS-13324:
--------------------------------------
    Description: 
While constructing full path prefix in constructFullPathPrefix method, below 
code can be expensive:
{code:java}
fullPath.insert(0, nsSummary.getDirName() + OM_KEY_PREFIX);{code}
 * Inserting at position {{0}} in a {{StringBuilder}} has 
{noformat}
O(n){noformat}
 cost because it must shift the entire buffer every time.

 * For deeply nested paths (e.g., {{{}/a/b/c/d/e/f/g/...{}}}), this compounds 
quickly.

  was:
While constructing full path prefix in constructFullPathPrefix method, below 
code can be expensive:
{code:java}
fullPath.insert(0, nsSummary.getDirName() + OM_KEY_PREFIX);{code}
 * Inserting at position {{0}} in a {{StringBuilder}} has *O(n)* cost because 
it must shift the entire buffer every time.

 * For deeply nested paths (e.g., {{{}/a/b/c/d/e/f/g/...{}}}), this compounds 
quickly.


> Ozone Recon - Optimize memory footprint for listKeys API.
> ---------------------------------------------------------
>
>                 Key: HDDS-13324
>                 URL: https://issues.apache.org/jira/browse/HDDS-13324
>             Project: Apache Ozone
>          Issue Type: Task
>          Components: Ozone Recon
>    Affects Versions: 2.0.0
>            Reporter: Devesh Kumar Singh
>            Assignee: Devesh Kumar Singh
>            Priority: Major
>
> While constructing full path prefix in constructFullPathPrefix method, below 
> code can be expensive:
> {code:java}
> fullPath.insert(0, nsSummary.getDirName() + OM_KEY_PREFIX);{code}
>  * Inserting at position {{0}} in a {{StringBuilder}} has 
> {noformat}
> O(n){noformat}
>  cost because it must shift the entire buffer every time.
>  * For deeply nested paths (e.g., {{{}/a/b/c/d/e/f/g/...{}}}), this compounds 
> quickly.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to