[svn:parrot] r41463 - trunk/src/pmc
chromatic at svn.parrot.org
chromatic at svn.parrot.org
Fri Sep 25 03:50:48 UTC 2009
Author: chromatic
Date: Fri Sep 25 03:50:41 2009
New Revision: 41463
URL: https://trac.parrot.org/parrot/changeset/41463
Log:
[PMC] Optimized FixedStringArray's set_number_keyed_int() and
set_integer_keyed_int() VTABLE entries to avoid unnecessary PMC and COW STRING
creation; this improves the array_access.pir benchmark performance by 13.28%.
Modified:
trunk/src/pmc/fixedstringarray.pmc
Modified: trunk/src/pmc/fixedstringarray.pmc
==============================================================================
--- trunk/src/pmc/fixedstringarray.pmc Fri Sep 25 03:50:28 2009 (r41462)
+++ trunk/src/pmc/fixedstringarray.pmc Fri Sep 25 03:50:41 2009 (r41463)
@@ -257,7 +257,6 @@
*/
VTABLE STRING *get_string_keyed_int(INTVAL key) {
-
STRING **str_array;
UINTVAL size;
@@ -358,11 +357,7 @@
*/
VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
- PMC *const ret = pmc_new(INTERP, enum_class_String);
- STRING *val;
-
- VTABLE_set_integer_native(INTERP, ret, value);
- val = VTABLE_get_string(INTERP, ret);
+ STRING *val = Parrot_str_from_int(interp, value);
SELF.set_string_keyed_int(key, val);
}
@@ -393,11 +388,7 @@
*/
VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) {
- PMC *const ret = pmc_new(INTERP, enum_class_String);
- STRING *val;
-
- VTABLE_set_number_native(INTERP, ret, value);
- val = VTABLE_get_string(INTERP, ret);
+ STRING *val = Parrot_str_from_num(interp, value);
SELF.set_string_keyed_int(key, val);
}
More information about the parrot-commits
mailing list