0

I have large system log (max 1GB) and I need to parse it for extracting certain things.

initially i wrote python code to reading file line by line (using with open) it took very very long time

I learned about mmap and using mmap it's taking around 5 mins .

(I have precompiled the regular expression to save time)

is there any better approach so that it takes less time ? (i am using python 2.7.3 32bit )

0

1 Answer 1

1

You might want to use awk for that kind of things, it's more or less what it's designed to do.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.