Skip to content

Commit

Permalink
Add optimization directives to the lookup table code
Browse files Browse the repository at this point in the history
  • Loading branch information
stevegrubb committed Mar 11, 2024
1 parent 89daf2c commit 85dc7d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions auparse/interpret.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
#define FAN_ALLOW 1
#define FAN_DENY 2
#endif

// This code is at the center of many performance issues. The following
// ensure that it is optimized the most without making all of the audit
// subsystem bigger.
#pragma GCC optimize("O3")
#pragma GCC optimize("-funroll-loops")

#include "auparse-defs.h"
#include "gen_tables.h"
#include "common.h"
Expand Down
6 changes: 6 additions & 0 deletions lib/lookup_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
#include <ctype.h>
#include <errno.h>

// This code is at the center of many performance issues. The following
// ensure that it is optimized the most without making all of the audit
// subsystem bigger.
#pragma GCC optimize("O3")
#pragma GCC optimize("-funroll-loops")

#include "libaudit.h"
#include "gen_tables.h"
#include "private.h"
Expand Down

0 comments on commit 85dc7d4

Please sign in to comment.