POV-Ray : Newsgroups : povray.advanced-users : function optimization question : Re: function optimization question Server Time
29 Jul 2024 12:24:21 EDT (-0400)
  Re: function optimization question  
From: Thorsten Froehlich
Date: 15 Mar 2002 15:01:50
Message: <3c92532e$1@news.povray.org>

Skiba <abx### [at] babilonorg>  wrote:

> As I remember text output of function parser - there were some kind of float
> variables/registers/stack entries. I though that every such float has
> dictionary feature (similiar to dictionary used gif coding) where every float
> has preprocessed string (without whitespaces) with syntax used to build this
> expression. So when new expression is calculated then it is verified with
> dictionary and use reference to ready float. But my imagination was probably
> far from implementation so forget it.

Sadly, it isn't that simple.  The internal representation is a tree so finding
a subexpression would require to compare every possible subtree of the
function with every other possible subtree.  This task gets very complex
quickly.  That is why there is usually an intermediate representation more
suitable for this "kind of pattern matching" in advanced compilers.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.