On 13/03/2019 17:04, Vlad Khorsun wrote:
> 
>   Sorry, it is still not clear - how one could know if node requires
> "specialization" ?
> Imagine a new developer who want to create new kind of Nodes - what is
> formal
> criteria of "specialized" node ?
> 
>   Currently it could be detected by return type of dsqlFieldRemapper (and
> probably dsqlPass, copy, pass1, pass2) virtual function(s) - if at least
> one
> of them returns type of current class (i.e. overrides return type of
> base class).
> Is it correct ?
> 
>   Anyway, it will be good to have documented formal criteria of
> "specialized" node.
> 

There is no criteria nor formalization, and should not be.

Things should be developed as needed and changed as needed without break
code.

That's what the check did.

If say a FieldNode::pass1 at a time always returns FieldNode* and at
later time someone decide it could return a ValueExprNode* (for a
computed field's expression), let it be, and if that broke code, the
code should be adjusted or the change must be different. It worked
perfectly to refactor dsql_nod/jrd_nod and develop new features catching
problems.


>>>> If the change really increases performance, then I suppose it should be
>>>> conditionally defined based on DEBUG build, so debug could use NodeRef
>>>> with virtual method and NodeRefImpl, and release something like
>>>> currently (non-virtual method and no NodeRefImpl usage).
>>>
>>>    According to profiler, new\delete of NodeRefImpl takes near 28% of
>>> request compilation time.
>>>
>>
>> It's should be possible to rewrite the code to have the checks and avoid
>> the performance problem.
> 
>   So far i see two possible solutions:
> 
> 1. what you offer (DEBUG build with old code and RELEASE build with new
> one)
> 
>   I can live with it, but want to try something that will not depend on
> build
> mode, thus:
> 

The less we depend on build mode the better, but option 2 does not seems
as an option.

I'll look and try to make the conditional code smaller possible.


Adriano


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to