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

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


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

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

Modified:
   trunk/src/pmc/imageio.pmc

Modified: trunk/src/pmc/imageio.pmc
==============================================================================
--- trunk/src/pmc/imageio.pmc	Mon May  3 08:57:09 2010	(r46232)
+++ trunk/src/pmc/imageio.pmc	Mon May  3 08:57:12 2010	(r46233)
@@ -542,11 +542,12 @@
                 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)) {
+                    ) {
                         STATICSELF.push_integer(i);
                         return;
                     }


More information about the parrot-commits mailing list