Re: [pygccxml-development] Another performance tweak
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2006-08-27 07:08:39
|
On 8/26/06, Allen Bierbaum <al...@vr...> wrote:
> >> - Caching the results of type_traits.remove_alias improved performance
> >> by 20%
> >
> >
> > Yes, this algorithms is used every where. Please don't commit this
> > change, I'd like
> > to think about it. I see next problem here: there are a lot of types,
> > so the cache
> > memory size could go out of control. Can you find out how many memory
> > Py++ takes with\without the cache?
>
> I can try to take a look at this. I don't have an easy way to do it
> right now but I will try later.
I am think that I don't want to introduce cache of results of type_traits.
I don't feel comfortable with them. One of the reasons is that it is
not that easy to
disable them.
> If you never call add_namespace_usage or add_namespace_alias, then will
> create_identifier ever need to do anything? Maybe we could make an
> optimization that keeps a global flag around and just skips the work in
> this method if you never set any namespace information. What do you think?
I think that you can replace create_identifier with "identity"
function and this solution
will always work :-)
def create_identifier_fast( creator, full_name ):
return full_name
And than replace create_identifier with the fast one from goodies.
I committed small changes to "optimization" feature. New feature: it
is possible to
control cache in all project:
for d in mb.decls():
d.cache.disable()
It is not easy to achieve same goal with types cache.
Would you mind to add documentation strings to the module?
I left some interesting problem to you: it is possible to optimize
declaration_path
algorithm even more. In most cases its complexity could be O(1). This
could be done
by saving intermediate results. Another way to say it: to re-use
parent declaration path
cache.
Can you publish top N lines of your benchmark result?
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|