Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating big documents is broken #96

Open
piotrkot opened this issue Feb 19, 2020 · 5 comments
Open

Creating big documents is broken #96

piotrkot opened this issue Feb 19, 2020 · 5 comments

Comments

@piotrkot
Copy link

I want to make a big document like this:

final Directives dirs = new Directives()
  .add("a");
for (final Element elem : blist) {
  dirs.add("b1").attr("id", 1);
}
for (final Element elem : clist) {
  dirs.add("c1").attr("id", 2);
}

Unfortunately, due to the internal usage of CopyOnWriteArrayList creating big documents becomes too expensive.

@0crat
Copy link
Collaborator

0crat commented Feb 19, 2020

@carlosmiranda/z please, pay attention to this issue

@0crat
Copy link
Collaborator

0crat commented Feb 19, 2020

@piotrkot/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot!

@piotrkot
Copy link
Author

A workaround is to create StringBuilder and use Directives(String) instead.

@muhmud
Copy link

muhmud commented Feb 26, 2020

Is there a way to have directives read from/written to a stream and then the result xml applied to another stream?

I'm also having memory problems when working with hundreds of thousands of Directives.

@yegor256
Copy link
Owner

@muhmud @piotrkot you guys are welcome to submit pull requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants