Using function of views_embed_view may caused high CPU loading I found that a page in my Drupal site is causing high CPU/memory loading, I tried to remove each item(e.g. block, custom PHP code and so on) on this page. Finally, I found that if I remove the code below will drop down the CPU/memory usage from 90% to 10%.

print views_embed_view('flag_compare', 'block_1');


Could someone suggest another function to embed view?
The function itself has not much to do with this, it is a wrapper for creating and displaying a view. The view you are displaying is a block - if you should have chosen to enable the block instead my guess is that the result would have been the same.

The most probable cause is the view you are displaying. Tools like views and panels are great at handling displaying stuff, but it comes at a price. They are usually a lot more ineffective than if you had done it with your own code, but they are also a lot faster to use. I would recommend that you review the view and try to find a way to reduce the workload by simplifying it, or if it's really important to you, do it yourself and skip a lot of the abstractions that Views bring.