Any change to optimize views_include_handler() function?
In single refreshment on my website followed line is executed 79 times:

require_once $filename;

79 calls takes around 5,99sec

CommentFileSizeAuthor
#5 Clipboard02.jpg149.91 KBkenorb

Comments

kenorb’s picture

Tested on AMD Athlon Dual Core 3GHz

merlinofchaos’s picture

That's just including required code. I don't know any way to optimize that. 5.99sec seems awfully long, I've never seen anything that nasty from just including some code.

kenorb’s picture

The content of file can be saved in cache to use it on the second refreshment to make it faster.
I know that the whole Drupal working on file includes instead of caching it (especially on theme functionality), but where it's possible to optimize it it's good to do that.
What do you think about that idea?

5.99sec was a sum of 79 calls of this function within one page refreshment. If somebody using more handlers, it will take much longer.

P.S. When I executed the profiler, that line was in top 10. I repeat it many times and each time it was the same.
I can make provide more tests if this could be consider.
I'm working on cache engine, where I can force caching on similar functions, but it will take me a while to make it compatible with Views.

merlinofchaos’s picture

Isn't this what things like APC do?

kenorb’s picture

StatusFileSize
new149.91 KB

Probably true, but only in case when you using APC it will be cached.
What if somebody not using it or hosting server doesn't support that?
I haven't seen in requirements that everybody need to use external cache.

Sorry I just found out that it was 5ms per one maximum execution, not sec:)
So 79 calls took in total 85ms only on this line (136ms the whole function). See attachment.
Page: day view on calendar

I just want to make my website work faster, and 2,5sec is quite long for one refreshment so I'm looking for some ways to improve it and in top 5 I've got views_include_handler()
Any workaround without APC, xcache or memcache?

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Ok, there is absolutely no way that any caching Views MIGHT do will do better than 5ms. It would be a lot of effort to maybe trim off 1ms but the extra code weight would probably actually cause it to take longer, IMO.

kenorb’s picture

Ok, thanks for your time:)