Which operation is fastest and creating less loading, LR web_reg_find()
or C strstr()
? Which is more preferable for a very strong loading test?
And if somebody knows how web_reg_find()
works, please tell me.
Which operation is fastest and creating less loading, LR web_reg_find()
or C strstr()
? Which is more preferable for a very strong loading test?
And if somebody knows how web_reg_find()
works, please tell me.
With strstr you would have to pull each and every component on a page and search after the download explicitly against a string in a buffer. With web_reg_find() you are setting a filtering condition through which every response component on a page passes.
If you choose the strstr() route you will still have to download the page components and then run the check against each component. You will use more memory and unless you are very good at your memory management you will likely miss a free() on occasion and introduce a memory leak condition, which is you are pressed for time to get a script out the door becomes a common side effect. With the web_reg_find() you can have it oppewrating concurrent to the page download with no slowdown on the page download itself.
I am not sure where Adriano has the research on raw performance of one versus the other since the operations of the two are so different as a web_reg_find() would be complete before a strstr() could even be initiated - I have to download and populate a buffer to search before I can search it.