summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Moore <Robert.Moore@intel.com>2012-10-24 12:59:50 -0700
committerRobert Moore <Robert.Moore@intel.com>2012-10-24 12:59:50 -0700
commit49dec9f2b8e8f0b15f787544731fe34173de8c38 (patch)
treef95df36291e0910dda132315841ba6a1367c2189
parent05432f7a2f00f7f6271e91747bfbbf5a4d7bca46 (diff)
downloadacpica-49dec9f2b8e8f0b15f787544731fe34173de8c38.tar.gz
Performance enhancement for ACPI package objects.
This change greatly increases the performance of package objects within the interpreter. It changes the processing of reference counts for packages by optimizing for the most common case where the package subobjects are either integers, strings, or buffers. Increases the performance of the ASLTS test suite by 1.5X. Chao Guan. ACPICA BZ 943.
-rw-r--r--source/components/utilities/utdelete.c40
1 files changed, 33 insertions, 7 deletions
diff --git a/source/components/utilities/utdelete.c b/source/components/utilities/utdelete.c
index 517f9c7bb..515ceebe4 100644
--- a/source/components/utilities/utdelete.c
+++ b/source/components/utilities/utdelete.c
@@ -649,17 +649,43 @@ AcpiUtUpdateObjectReference (
for (i = 0; i < Object->Package.Count; i++)
{
/*
- * Push each element onto the stack for later processing.
- * Note: There can be null elements within the package,
- * these are simply ignored
+ * Null package elements are legal and can be simply
+ * ignored.
*/
- Status = AcpiUtCreateUpdateStateAndPush (
- Object->Package.Elements[i], Action, &StateList);
- if (ACPI_FAILURE (Status))
+ NextObject = Object->Package.Elements[i];
+ if (!NextObject)
{
- goto ErrorExit;
+ continue;
+ }
+
+ switch (NextObject->Common.Type)
+ {
+ case ACPI_TYPE_INTEGER:
+ case ACPI_TYPE_STRING:
+ case ACPI_TYPE_BUFFER:
+ /*
+ * For these very simple sub-objects, we can just
+ * update the reference count here and continue.
+ * Greatly increases performance of this operation.
+ */
+ AcpiUtUpdateRefCount (NextObject, Action);
+ break;
+
+ default:
+ /*
+ * For complex sub-objects, push them onto the stack
+ * for later processing (this eliminates recursion.)
+ */
+ Status = AcpiUtCreateUpdateStateAndPush (
+ NextObject, Action, &StateList);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+ break;
}
}
+ NextObject = NULL;
break;
case ACPI_TYPE_BUFFER_FIELD: