From: nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Date: Sun, 1 Jul 2007 03:42:49 +0000 (+0000)
Subject: massively reduce the number of forks that busybox ash has to do while processing... 
X-Git-Url: https://git.rohieb.name/openwrt.git/commitdiff_plain/d412cd8af29a929a4235bb214ea3ca867c128196?ds=inline

massively reduce the number of forks that busybox ash has to do while processing our scripts
this is accomplished simply by changing the order in which it looks for builtins and applets


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7815 3c298f89-4303-0410-b956-a3cf2f4a3e73
---

diff --git a/package/busybox/patches/270-ash_performance.patch b/package/busybox/patches/270-ash_performance.patch
new file mode 100644
index 000000000..eff7a5bb1
--- /dev/null
+++ b/package/busybox/patches/270-ash_performance.patch
@@ -0,0 +1,30 @@
+Index: busybox-1.4.2/shell/ash.c
+===================================================================
+--- busybox-1.4.2.orig/shell/ash.c	2007-07-01 05:33:08.371737750 +0200
++++ busybox-1.4.2/shell/ash.c	2007-07-01 05:33:11.703946000 +0200
+@@ -3957,12 +3957,6 @@
+ 	}
+ #endif
+ 
+-	if (is_safe_applet(name)) {
+-		entry->cmdtype = CMDNORMAL;
+-		entry->u.index = -1;
+-		return;
+-	}
+-
+ 	updatetbl = (path == pathval());
+ 	if (!updatetbl) {
+ 		act |= DO_ALTPATH;
+@@ -4074,6 +4068,12 @@
+ 		goto success;
+ 	}
+ 
++	if (is_safe_applet(name)) {
++		entry->cmdtype = CMDNORMAL;
++		entry->u.index = -1;
++		return;
++	}
++
+ 	/* We failed.  If there was an entry for this command, delete it */
+ 	if (cmdp && updatetbl)
+ 		delete_cmd_entry();