Enlightenment CVS committal

Author  : onefang
Project : e17
Module  : apps/e_utils

Dir     : e17/apps/e_utils/src/bin/e17genmenu/src/bin


Modified Files:
        icons.c main.c menus.c 


Log Message:
Instrumentation to check the performance.

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/icons.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- icons.c     16 Feb 2006 09:19:25 -0000      1.18
+++ icons.c     19 Feb 2006 08:13:49 -0000      1.19
@@ -8,6 +8,8 @@
 #include "parse.h"
 
 
+extern double icon_time;
+
 /* FIXME: Ideally this should be -
  * {".png", ".svg", ".xpm", "", NULL}
  * Add them in when they are supported in .eaps.
@@ -143,9 +145,14 @@
 
    char icn[MAX_PATH], path[MAX_PATH];
    char *theme_path, *found;
+   double begin;
 
+   begin = ecore_time_get();
    if (icon == NULL)
-      return DEFAULTICON;
+      {
+         icon_time += ecore_time_get() - begin;
+         return DEFAULTICON;
+      }
 
 #ifdef DEBUG
    fprintf(stderr, "\tTrying To Find Icon %s (%s) in theme %s\n", icon, 
icon_size, icon_theme);
@@ -270,7 +277,10 @@
                                                         if (found)
                                                            {
                                                               if (match)   /* 
If there is a match in sizes, return the icon. */
-                                                                 return found;
+                                                                  {
+                                                                     icon_time 
+= ecore_time_get() - begin;
+                                                                    return 
found;
+                                                                 }
                                                               if (result_size 
< minimal_size)   /* While we are here, figure out our next fallback strategy. 
*/
                                                                  {
                                                                     
minimal_size = result_size;
@@ -285,14 +295,20 @@
 
                                  /* Fall back strategy #1, look for closest 
size in this theme. */
                                 if (closest)
-                                   return closest;
+                                    {
+                                       icon_time += ecore_time_get() - begin;
+                                      return closest;
+                                   }
 
                                  /* Fall back strategy #2, Try again with the 
parent theme. */
                                 if ((inherits) && (inherits[0] != '\0') && 
(strcmp(icon_theme, "hicolor") != 0))
                                    {
                                        found = find_fdo_icon(icon, icon_size, 
inherits);
                                       if (found != DEFAULTICON)
-                                         return found;
+                                          {
+                                             icon_time += ecore_time_get() - 
begin;
+                                            return found;
+                                         }
                                    }
 
                                  /* Fall back strategy #3, Try the default 
hicolor theme. */
@@ -300,7 +316,10 @@
                                    {
                                        found = find_fdo_icon(icon, icon_size, 
"hicolor");
                                       if (found != DEFAULTICON)
-                                         return found;
+                                          {
+                                             icon_time += ecore_time_get() - 
begin;
+                                            return found;
+                                         }
                                    }
 
                                  /* Fall back strategy #4, Just search in the 
base of the icon directories. */
@@ -312,7 +331,10 @@
 #endif
                                         found = 
fdo_paths_search_for_file(FDO_PATHS_TYPE_ICON, path, 0, NULL, NULL);
                                        if (found)
-                                         return found;
+                                           {
+                                              icon_time += ecore_time_get() - 
begin;
+                                             return found;
+                                          }
                                     }
 
                              }
@@ -322,5 +344,6 @@
         free(theme_path);
       }
 
+   icon_time += ecore_time_get() - begin;
    return DEFAULTICON;
 }
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/main.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- main.c      18 Feb 2006 02:12:25 -0000      1.23
+++ main.c      19 Feb 2006 08:13:49 -0000      1.24
@@ -218,14 +218,19 @@
    return;
 }
 
+double convert, icon_time = 0.0;
+int menu_count, item_count;
+
 int
 main(int argc, char **argv)
 {
    char path[MAX_PATH];
+   double start, begin, paths, gen;
 
    /* Init E Stuff */
    _e17genmenu_init();
 
+   start = ecore_time_get();
    /* Parse Arguments */
    _e17genmenu_parseargs(argc, argv);
 //_e17genmenu_test_fdo_paths();  /* For debugging purposes, makes it easier to 
gdb this. */
@@ -234,11 +239,16 @@
    ecore_app_args_set(argc, (const char **)argv);
 
    /* Get the fdo paths. */
+   begin = ecore_time_get();
    fdo_paths_init();
+   paths = ecore_time_get() - begin;
    parse_ini_init();
 
+   begin = ecore_time_get();
    /* Start Making Menus */
    make_menus();
+   convert -= begin;
+   gen = ecore_time_get() - begin;
 
    /* Sort Menus */
    sort_favorites();
@@ -252,6 +262,8 @@
             get_home());
    system(path);
 
+  printf("\nTotal time %3.3f seconds, generate fdo paths %3.3f, convert fdo 
menus %3.3f, generate %d eaps in %d menus %3.3f, finding icons %3.3f.\n", 
ecore_time_get() - start, paths, convert, item_count, menu_count, gen - 
icon_time, icon_time);
+
    parse_ini_shutdown();
    fdo_paths_shutdown();
 
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/menus.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- menus.c     19 Feb 2006 07:28:13 -0000      1.10
+++ menus.c     19 Feb 2006 08:13:49 -0000      1.11
@@ -6,6 +6,10 @@
 #include "menus.h"
 #include "xmlame.h"
 
+extern double convert;
+extern int menu_count, item_count;
+
+
 static int _menu_make_apps(const void *data, Dumb_List *list, int element, int 
level);
 static void _menu_dump_each_hash_node(void *value, void *user_data);
 
@@ -35,6 +39,7 @@
 
                     /* convert the xml into menus */
                     menus = fdo_menus_get(menu_file, menu_xml);
+                    convert = ecore_time_get();
                     if (menus)
                        {
                           /* create the .eap and order files from the menu */
@@ -151,6 +156,7 @@
                pool  = (Ecore_Hash *) list->elements[element + 2].element;
                apps  = (Ecore_Hash *) list->elements[element + 4].element;
                printf("MAKING MENU - %s \t\t%s\n", path, name);
+              menu_count++;
                ecore_hash_for_each_node(apps, _menu_dump_each_hash_node, 
&path[11]);
            }
       }
@@ -167,5 +173,6 @@
    node = (Ecore_Hash_Node *) value;
    file = (char *) node->value;
    printf("MAKING EAP %s -> %s\n", path, file);
+   item_count++;
    parse_desktop_file(strdup(file), path);
 }




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to