Is Perl faster than bash?

前端 未结 10 1999
刺人心
刺人心 2020-12-15 09:26

I have a bash script that cuts out a section of a logfile between 2 timestamps, but because of the size of the files, it takes quite a while to run.

If I were to rew

10条回答
  •  北荒
    北荒 (楼主)
    2020-12-15 09:57

    You will almost certainly realize a massive speed benefit from writing your script in Perl just by cutting off the file read when you pass your second timestamp.

    More generally, yes; a bash script of any complexity, unless it's a truly amazing piece of wizardry, can handily be outperformed by a Perl script for equivalent inputs and outputs.

提交回复
热议问题