Ethereal-cvs: [Ethereal-cvs] cvs commit: ethereal/epan proto.c proto.h

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Ronnie Sahlberg <sahlberg@xxxxxxxxxxxxxxxxx>
Date: Mon, 24 Nov 2003 15:12:11 -0600 (CST)
sahlberg    2003/11/24 15:12:11 CST

  Modified files:
    epan                 proto.c proto.h 
  Log:
  performance enhancement to proto.c
  
  Removed the GMemChunk used to allocate/free field_info structures
  and used a free list to store the freed structs until they are allocated again.
  
  Ethereal will allocate more field_info structs as it needs to but never free them. Instead the are just placed in a cheap and fast free list so that if we
  want to use the struct again, this will be fast.
  
  This affects the speed of the two functions
  alloc_field_info() that should be slightly faster now
  free_field_info() that was replaced with a 2 line macro.
  
  All in all  my testing suggests that ethereal is 2-3% faster with this patch.
  
  Revision  Changes    Path
  1.107     +60 -21    ethereal/epan/proto.c
  1.45      +9 -2      ethereal/epan/proto.h