Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
save_ts: use list instead of str concat. BZ 1600383
Instead of accumulating a long string object, build up a list and join it at the end into a string. Even though modern Pythons are optimized for such string concatenations, we're hitting some edge cases in Anaconda where the save_ts() method becomes really slow when dumping large transactions (~80 seconds for a "Server with GUI" selection including all Add-Ons on RHEL-7.6). Using the list paradigm here (which is a good practice[1] anyway) reduces that time to ~20 seconds for the same transaction. Of course, the proper fix should land in Anaconda/Python[2] eventually but let's do this as a hotfix for now. [1] https://docs.python.org/3/faq/programming.html#what-is-the-most-efficient-way-to-concatenate-many-strings-together [2] https://bugzilla.redhat.com/show_bug.cgi?id=1674016
- Loading branch information