Page MenuHomeFreeBSD

Get rid of unneccessary ioctls.
ClosedPublic

Authored by trasz on Oct 15 2018, 12:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 8, 1:45 AM
Unknown Object (File)
Mar 4 2024, 8:11 AM
Unknown Object (File)
Feb 12 2024, 3:42 PM
Unknown Object (File)
Jan 6 2024, 7:30 PM
Unknown Object (File)
Dec 20 2023, 3:16 AM
Unknown Object (File)
Dec 10 2023, 8:48 PM
Unknown Object (File)
Sep 24 2023, 6:05 PM
Unknown Object (File)
Sep 2 2023, 3:49 PM
Subscribers

Details

Summary

Prevent flex(1) from generating calls to isatty(3) - and, in turn,
TIOCGETA ioctls - when parsing nsswitch.conf(5).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

The flex man page suggests there's a performance improvement if we use -CF or -Cf as well. -CFr or -Cfr may also be beneficial since it beneficial. The man page warns against increased size, but I doubt the differences that were important when flex was written (1995) are relevant today. If we're looking at performance tuning, we should look here.

Adding -CFr does increase the size, but not be enough to matter:

  9978      4    88   10070   0x2756   nslexer.o.no-CFr
26883      4    80   26967   0x6957   nslexer.o.-CFr

so ~16k increase in size. If you have a way to benchmark things, you might see if this is faster or not.

This revision is now accepted and ready to land.Oct 15 2018, 2:32 PM
markj added inline comments.
lib/libc/net/nslexer.l
56 ↗(On Diff #49160)

Keep these sorted?

This revision now requires review to proceed.Oct 15 2018, 3:31 PM
In D17564#374936, @imp wrote:

The flex man page suggests there's a performance improvement if we use -CF or -Cf as well. -CFr or -Cfr may also be beneficial since it beneficial. The man page warns against increased size, but I doubt the differences that were important when flex was written (1995) are relevant today. If we're looking at performance tuning, we should look here.

Adding -CFr does increase the size, but not be enough to matter:

  9978      4    88   10070   0x2756   nslexer.o.no-CFr
26883      4    80   26967   0x6957   nslexer.o.-CFr

so ~16k increase in size. If you have a way to benchmark things, you might see if this is faster or not.

I'll keep that in mind, although for now I'm just shaving off useless syscalls :-)

This revision was not accepted when it landed; it landed in state Needs Review.Oct 15 2018, 7:48 PM
This revision was automatically updated to reflect the committed changes.