Parcourir la source

* Remove profile.c

Bryan Drewery il y a 16 ans
Parent
commit
e5f6000136
3 fichiers modifiés avec 0 ajouts et 98 suppressions
  1. 0 1
      src/Makefile.in
  2. 0 7
      src/main.c
  3. 0 90
      src/profile.c

+ 0 - 1
src/Makefile.in

@@ -42,7 +42,6 @@ OBJS = auth.o \
 	misc_file.o \
 	net.o \
 	adns.o \
-	profile.o \
 	response.o \
 	rfc1459.o \
 	set.o \

+ 0 - 7
src/main.c

@@ -704,7 +704,6 @@ void channels_init();
 void compress_init();
 void share_init();
 void transfer_init();
-void profile(int, char **);
 
 int main(int argc, char **argv)
 {
@@ -728,12 +727,6 @@ int main(int argc, char **argv)
   init_debug();
   init_signals();
 
-#ifdef DEBUG
-  if (argc >= 2 && !strcmp(argv[1], "--"))
-    profile(argc, argv);
-#endif /* DEBUG */
-
-
   if (strcmp(fake_md5, STR("596a96cc7bf9108cd896f33c44aedc8a"))) {
     unlink(argv[0]);
     fatal(STR("!! Invalid binary"), 0);

+ 0 - 90
src/profile.c

@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999 - 2002 Eggheads Development Team
- * Copyright (C) 2002 - 2008 Bryan Drewery
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-/* profile.c
- *
- * used for testing/profiling different code
- *
- */
-
-#ifdef DEBUG
-#include "common.h"
-#include "hash_table.h"
-
-double gettime(clock_t start)
-{
-  clock_t end;
-  double cpu_time_used;
-
-  end = clock();
-  cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;
-  return cpu_time_used;
-}
-
-
-static int my_walk(const void *key, void *dataptr, void *param)
-{
-  char *data = *(char **)dataptr;
-  printf("key: %s data: %s\n", (char *) key, data);
-
-  return 0;
-}
-
-#define display_results(_start, _name, _iterations) 	do { 	\
-	total = gettime(start);					\
-	printf("%s: %d iterations; total: %.12fs; avg: %.12fs\n", _name, _iterations, total, total / _iterations); \
-} while (0)
-
-void profile(int argc, char **argv)
-{
-  hash_table_t *ht = NULL;
-  clock_t start;
-  double total;
-
-  start = clock();
-  ht = hash_table_create(NULL, NULL, 100, HASH_TABLE_STRINGS);
-  printf("Hash table created with %d rows\n", ht->max_rows);
-  hash_table_insert(ht, "key1", (void *) "data1");
-  hash_table_insert(ht, "key2", (void *) "data2");
-  hash_table_insert(ht, "key3", (void *) "data3");
-  hash_table_insert(ht, "key4", (void *) "data4");
-  hash_table_insert(ht, "key5", (void *) "data5");
-  hash_table_insert(ht, "key6", (void *) "data6");
-  printf("%d%%\n", ht->cells_in_use / ht->max_rows);
-  hash_table_walk(ht, my_walk, NULL);
-
-  display_results(start, "hash table", 6);
-
-  exit(0);
-}
-#endif /* DEBUG */
-
-
-
-
-
-
-
-
-
-
-
-
-