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

write_ods(append = TRUE) and write_ods(update = TRUE) are still slow #141

Closed
chainsawriot opened this issue Aug 18, 2023 · 2 comments
Closed

Comments

@chainsawriot
Copy link
Collaborator

chainsawriot commented Aug 18, 2023

Despite #113 , append and update are still slow due to the reliance on xml2. And this is the last part we need xml2.

I need to study the rapidxml code to learn how to modify the DOM tree with cpp.

@chainsawriot chainsawriot changed the title write_ods(append = TRUE) and write_ods(update = FALSE) are still slow write_ods(append = TRUE) and write_ods(update = TRUE) are still slow Aug 18, 2023
@pbrohan
Copy link
Contributor

pbrohan commented Aug 24, 2023

I would actually guess that it would be faster to simply use a similar method to the current method of writing, and write the sheets with no headers to temp files and then concatenate them together, rather than trying to actually edit the XML tree itself in memory.

I guess you could make massive files by appending files that don't fit in memory this way, so you could write a file that you cannot then read, but it could be argued that this would in fact be the user's fault.

@chainsawriot
Copy link
Collaborator Author

@pbrohan Given the fact that write_ods can now write list of data frames; an idea similar to yours is to read all sheets from the ODS file as list; modify the content of the list; and then write the list as ODS.

To me, it sounds fine (might still faster than xml2). The potential problem is that the roundtrip of read_ods and then write_ods is not lossless for ODS files produced from other sources (format, date, comments, merged cells and whatnot).

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

No branches or pull requests

2 participants