tiny /etc/passwd parsing optimization

Václav Zeman vhaisman@gmail.com
Fri Feb 3 12:10:00 GMT 2012


Hi.
I was looking into how to speed up /etc/passwd parsing. Here is a
trivial patch that improves pwdgrp::parse_passwd() by a tiny bit.
Similar change can be applied to pwdgrp::parse_group() as well. The
resulting assembler shows that it avoids recomputing the pointers into
the array.

2012-02-02  Vaclav Zeman  <vhaisman@gmail.com>

        * passwd.cc (pwdgrp::parse_passwd): Use reference instead of
        #define to access current passwd_buf element.
        * grp.cc (pwdgrp::parse_group): Use reference instead of #define
        to access current group_buf element.

--
VZ
-------------- next part --------------
A non-text attachment was scrubbed...
Name: passwd.cc.diff
Type: application/octet-stream
Size: 580 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20120203/96eed2b8/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grp.cc.diff
Type: application/octet-stream
Size: 449 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20120203/96eed2b8/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: passwd.s.diff
Type: application/octet-stream
Size: 2507 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20120203/96eed2b8/attachment-0002.obj>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list