POV-Ray : Newsgroups : povray.pov4.discussion.general : Caching parsed code : Re: Caching parsed code Server Time
2 May 2024 22:40:50 EDT (-0400)
  Re: Caching parsed code  
From: Warp
Date: 16 Apr 2009 11:50:54
Message: <49e753de@news.povray.org>
nemesis <nam### [at] gmailcom> wrote:
> That's unexpected.

>  From just the looks of it, the SDL parser seems so straightforward that 
> it's difficult to reason where any slowness could be coming from. 

  It's not difficult at all:

1) SDL is not byte-compiled. It's parsed&interpreted on the fly.

2) SDL loops are implemented by seeking the input file and continuing
the parsing from there. No caching of previously-parsed code of any kind.

  So not only do you get the overhead of re-parsing the code every time
it loops, you always get the same file I/O overhead.

  Another issue is that I wouldn't be surprised if the *parsing* itself is
faster in the perl interpreter than in povray. What looks "straightforward"
to you might still not be the fastest way of parsing, tokenizing and
interpreting the code.

> What you did was just measure SDL's slow macro processing

  What "macro processing"? I didn't use any macros.

-- 
                                                          - Warp


Post a reply to this message

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