3 Replies - 1638 Views - Last Post: 31 December 2013 - 10:32 AM

#1 Luckless  Icon User is offline

  • </luck>
  • member icon

Reputation: 293
  • View blog
  • Posts: 1,146
  • Joined: 31-August 09

Lang=C Makes grep Faster?

Posted 15 December 2013 - 07:38 PM

I found this article on reddit tonight and thought it was interesting. I'm not a Linux/UNIX expert, but as someone who uses grep on sizable log files at work, this looks pretty cool. Does anyone with more knowledge on the subject know reasons this shouldn't be done? Any input would be great =)
Is This A Good Question/Topic? 1
  • +

Replies To: Lang=C Makes grep Faster?

#2 nathanpc  Icon User is offline

  • SCIENCE!
  • member icon

Reputation: 112
  • View blog
  • Posts: 1,171
  • Joined: 31-July 09

Re: Lang=C Makes grep Faster?

Posted 18 December 2013 - 06:13 AM

Very interesting... In the comments section a user pointed out the reason why this works:

LTCT said:

The main factor is the case insensitive search. Case insensitivity in locales other than C is hard (é == É, and so forth).

This post has been edited by nathanpc: 18 December 2013 - 06:14 AM

Was This Post Helpful? 0
  • +
  • -

#3 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3662
  • View blog
  • Posts: 11,466
  • Joined: 05-May 12

Re: Lang=C Makes grep Faster?

Posted 25 December 2013 - 10:59 PM

As I recall, the character sets that are legal for ANSI compliant characters are also pretty limited... mostly just ASCII characters. So that means you don't need to worry about DBCS (double byte character set), or UTF-8 encodings and their special handling rules where some sequences of bytes or equivalent to another set of bytes even if they don't look anything alike.
Was This Post Helpful? 0
  • +
  • -

#4 Curtis Rutland  Icon User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4577
  • View blog
  • Posts: 8,019
  • Joined: 08-June 10

Re: Lang=C Makes grep Faster?

Posted 31 December 2013 - 10:32 AM

I suggest reading through the comments on the reddit post:

http://www.reddit.co..._submitted=true

It's clear that this is for a limited set of use cases.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1