AWK脚本会占用大量CPU吗? [英] Does an AWK script take up a lot of CPU?

查看:149
本文介绍了AWK脚本会占用大量CPU吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AWK是否使用大量处理能力?如果是这样,是否有更好的脚本语言可以做到这一点?还是我应该在C本身(其余代码在哪里)中完成此操作。

Does AWK uses a lot of processing power? If so, is there a better scripting language to do it? Or should I do it in C itself (where rest of my code is).

推荐答案

取决于您所讲的内容去做。不管您使用哪种语言,大部分工作都会传递给正则表达式引擎。

Depends on what you're telling it to do. Most of the work is passed to the regexp engine, which should be similar, no matter what language you use.

现在,如果您是从a里面使用awk脚本C程序,您也有资源也可以在C中实现功能,因此最好这样做。您将避免流程的创建/终止+通信开销(这可能会或可能不会成为您获得性能影响的主要部分)。

Now if you're using an awk script from inside a C program, and you have the resources to just implement the functionality in C too, you're best off doing that. You'll avoid the process creation/termination + communication overhead (which may or may not be a big part of the performance hit you'll get).

有关更多信息,告诉我们更多有关您的脚本的信息!

For more information, tell us more about your script!

这篇关于AWK脚本会占用大量CPU吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆