[svn:parrot] r46232 - trunk/src/pmc

chromatic at svn.parrot.org chromatic at svn.parrot.org
Mon May 3 08:57:09 UTC 2010


Author: chromatic
Date: Mon May  3 08:57:09 2010
New Revision: 46232
URL: https://trac.parrot.org/parrot/changeset/46232

Log:
[PMC] Rearranged STRING comparisons in ImageIOSize PMC's push_string() to
filter out mismatched STRINGs earlier.  This improves the NQP-based benchmark
by another 21.280%.

Modified:
   trunk/src/pmc/imageiosize.pmc

Modified: trunk/src/pmc/imageiosize.pmc
==============================================================================
--- trunk/src/pmc/imageiosize.pmc	Mon May  3 08:57:06 2010	(r46231)
+++ trunk/src/pmc/imageiosize.pmc	Mon May  3 08:57:09 2010	(r46232)
@@ -253,11 +253,11 @@
                 PackFile_Constant *constant = table->constants[i];
                 if (constant->type == PFC_STRING) {
                     STRING * const sc = constant->u.string;
-                    if (Parrot_charset_number_of_str(interp, v)
+                    if (Parrot_str_equal(interp, v, sc)
+                    &&  Parrot_charset_number_of_str(interp, v)
                     ==  Parrot_charset_number_of_str(interp, sc)
                     &&  Parrot_encoding_number_of_str(interp, v)
-                    ==  Parrot_encoding_number_of_str(interp, sc)
-                    &&  Parrot_str_equal(interp, v, sc)) {
+                    ==  Parrot_encoding_number_of_str(interp, sc)) {
                         STATICSELF.push_integer(i);
                         return;
                     }


More information about the parrot-commits mailing list