This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Performance issue with GNU/ld and DLL
- From: Pascal Obry <pascal at obry dot net>
- To: nick clifton <nickc at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 09 Feb 2012 19:31:02 +0100
- Subject: Re: Performance issue with GNU/ld and DLL
- References: <4F23FE5A.7040108@obry.net> <4F2E47C4.8010505@obry.net> <4F2FD2F9.6000500@redhat.com>
- Reply-to: pascal at obry dot net
Nick,
First thanks for your answer.
I have identified the slowness. This is because in pe-dll.c we have:
<<
static int
auto_export (bfd *abfd, def_file *d, const char *n)
{
int i;
struct exclude_list_struct *ex;
const autofilter_entry_type *afptr;
const char * libname = 0;
if (abfd && abfd->my_archive)
libname = lbasename (abfd->my_archive->filename);
for (i = 0; i < d->num_exports; i++)
if (strcmp (d->exports[i].name, n) == 0)
return 0;
...
>>
Removing the above loop the code runs has fast for building executable
than for building DLL. Just looking at the code it is clear that we have
an O(nÂ) performance issue. For each export we look at all currently
exports to see if it has not yet been handled!
A solution would be to use a hash table or something like that. What
would you advise (I do not know well the binutils sources), I'm willing
to try fixing this issue.
Thanks,
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net - http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B