On 10/24/06, Matthias Baas <ba...@ir...> wrote:
> Hi,
>
> the optimizations mentioned in my previous mail depend on a small
> modification to pygccxml, namely that the result of parsing XML files is
> also stored in the cache (otherwise parsing the file takes longer and my
> query cache wouldn't work at all). So I'm suggesting an updated version
> of source_reader_t.read_xml_file() that makes use the cache (if the user
> wouldn't want to cache the file he would not specify a cache in the
> first place, would he?):
>
>
> def read_xml_file(self, gccxml_created_file):
> """
> Reads GCC-XML generated XML file.
>
> @param gccxml_created_file: path to GCC-XML generated file
> @type gccxml_created_file: str
>
> @return: declarations tree
> """
> self.logger.debug( "Reading xml file: [%s]" % gccxml_created_file )
>
> assert(self.__config!=None)
> declarations = self.__dcache.cached_value( gccxml_created_file,
> self.__config )
> if not declarations:
> self.logger.debug( "File has not been found in cache,
> parsing..." )
> declarations, files = self.__parse_gccxml_created_file(
> gccxml_created_file )
> self.__dcache.update( gccxml_created_file, self.__config,
> declarations, [] )
> else:
> self.logger.debug( "File has not been changed, reading
> declarations from cache." )
>
> return declarations
>
>
> So, Roman, is it ok when I commit this modification?
Yes if you add small changes to it: please use full file name to
update and read from
cache.
Thanks.
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|