Poor performance when building simplexml object for configuration #2143
Replies: 4 comments
-
Hi How many times this method is called? I know indeed that simplexml is not very performant but in order to do any optimization the case you have need to be described much better. |
Beta Was this translation helpful? Give feedback.
-
I've thought about improvements for SimpleXML many times but I think the only way to improve it would be to replace it (e.g. with native PHP arrays) but that would be a lot of effort and break a lot of code so I don't really see it being feasible. However, unless I've forgotten something once the config is cached, increasing the number of stores should not really hurt performance since the cache is broken down into different "sections" for each website/store and only the ones used in a request should be loaded, so it should only be loading one store per request. |
Beta Was this translation helpful? Give feedback.
-
I was looking into something recently that's slightly related. Magento does not do It's not a huge performance cost for Redis but I can imagine that people that have the cache in the database and lots of storeviews might suffer a bit. |
Beta Was this translation helpful? Give feedback.
-
Ahh, nice find! I had never noticed that code before and you are absolutely right, it results in a cache load/save for every store on every request! It only has a handful of keys so they are small payloads but still that is pretty significant for large numbers of stores. It seems that it would be much better to load/save all stores as one cache record since all of them are always loaded anyway. |
Beta Was this translation helpful? Give feedback.
-
I have a Magento site which has quite many store (around 100 website/store). I'm trying to achieve a performance issue with Magento and I found that PHP (7.x) has a very poor performance when building the simplexml object from cached XML string
I was trying to find a way to cache this object directly however simplexml object has no serialize interface, even I tried to use this library but it doesn't support as well
https://github.com/igbinary/igbinary
Has anyone gotten any idea?
@colinmollenhour @Vinai
Beta Was this translation helpful? Give feedback.
All reactions