How to efficiently replace specific text in a large number of texts

there is a scenario where some text in a text with 20w characters needs to be regularly matched and replaced.

but for cards that are special in this process, using chrome browsers under mac will get stuck for nearly 20s. If you perform such a task several times, it will naturally take a lot of time.

is there a faster way to do this?

Mar.16,2021

regular global replacement is too slow. You can only change the strategy. For example, if you don't have to replace it all at once, you can replace that part separately when you need to use it. Or read multiple buffer when reading, and then open worker multithreaded replacement. You can drop a progress bar to let the user know that you are dealing with


20w characters that do not need to be displayed at once and processed in segments. Just make sure that the initial render load of the page meets the visual range.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3d207-413ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3d207-413ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?