XML as a virtual registry slows down the application

I am creating an application virtualization product. I am using an XML file as a virtual registry. Virtual applications created from my software access the Xml virtual registry. It works, but it works very slowly.

I load and unload XML on every call to the registry API, because a multiprocess stream from the parent accesses a single registry file. This can slow down the application.

Can someone point me to an alternative for XML ...

+4
source share
4 answers

Time to convert text to tree. I dealt with this in my code using Loadaing and Parsing XML in all processes, only after the recording occurred in any of the processes.

0
source

You can use a database instead. That would be faster. Sqlite is lightweight and powerful.

+1
source

If you load it into memory and start working with it, then your problem is not in XML. Profile your application to find out where she spends most of her time. I think you will probably find that you spend most of the time looking for the item you want to access.

0
source

Well, of course, you can always use a real registry, which is thread safe and fast ...

Otherwise, you will have to create a separate process that manages your virtual XML registry, keeping the XML structure in memory, so it does not need to read / write constantly. Then, the processes that should be able to access it can use IPC to communicate with the registration process.

Another idea: if several processes are unlikely to constantly update the registry: keep the virtual XML registry in memory and write it to disk when changing, but asynchronously through the background thread. When accessing the registry, first check if the file has been modified; if not, you do not need to restart it.

0
source

Source: https://habr.com/ru/post/1339466/


All Articles