mardi 23 avril 2019

Simple Regular Expression API's computation taking high Virtual Memory

I'm working on embedded cpp project and I have to work on Regular Expression in one of the component 'X'. Hence, I used simple regcomp/regexec in my application for the particular component 'X'.

Component 'X' takes continuous text buffer as a input and to filter few logs I used 10 simple expressions with regcomp/regexec API's. To test the performance, I left the device untouched/disturbed for more than 12 hrs and when I check the 'top' command, 'VSZ%' of that particular component is ~95% and CPU% is about ~16% :(

Here are my doubts: 1) Why does simple regcomp/regexec is taking ~16% of CPU? Maybe as the input is continuous text buffer and to filter the RegEx every time is it going to ~16%? Is that expected/is it too high considering the simple RegEx API's? 2) What could be the reason of component 'X' taking ~95% of VSZ%? Again, Is this expected? If so, could you please let me know why?

Kindly, help me understand the concept and overcome the issue. Thanks in Advance

Aucun commentaire:

Enregistrer un commentaire