POV-Ray : Newsgroups : povray.programming : Bug? excessive opening of source file Server Time
22 Dec 2024 01:09:13 EST (-0500)
  Bug? excessive opening of source file (Message 1 to 3 of 3)  
From: Eric Buddington
Subject: Bug? excessive opening of source file
Date: 27 Aug 2006 13:15:00
Message: <web.44f1d1925db36c99abef64010@news.povray.org>
I'm running Povray 3.6.1 in Linux 2.6.7-mm6 on an Athlon XP.

While studying very slow performance on an sshfs disk (encrypted network
filesystem), I discovered via strace that Povray is re-opening the main
..pov file about 120,000 times.

This seems to be related to the part of my code that reads in data for
sphere locations. Varying the size of the data file changes the number of
opens (of the main .pov file)

Throughout this, the data file is opened twice, and the .inc file that reads
the data file is opened once. It's only the main .pov file that gets
reopened obsessively.

524641 opens with full file (87475 lines, 437375 numbers)
118234 opens with small file (19714 lines, 98570 numbers)
5997 opens with tiny file (1000 lines, 5000 numbers)

So in short, the source file is opened about 5.997 times for each data line
read. Poking through the POV source hasn't enlightened me yet. Can anyone
explain this (the behaviour, not my failure to understand the source)?

-Eric


Post a reply to this message

From: Christoph Hormann
Subject: Re: Bug? excessive opening of source file
Date: 27 Aug 2006 14:50:03
Message: <ecspca$f9i$1@chho.imagico.de>
Eric Buddington wrote:
> I'm running Povray 3.6.1 in Linux 2.6.7-mm6 on an Athlon XP.
> 
> While studying very slow performance on an sshfs disk (encrypted network
> filesystem), I discovered via strace that Povray is re-opening the main
> ..pov file about 120,000 times.
> 
> This seems to be related to the part of my code that reads in data for
> sphere locations. Varying the size of the data file changes the number of
> opens (of the main .pov file)
> 
> Throughout this, the data file is opened twice, and the .inc file that reads
> the data file is opened once. It's only the main .pov file that gets
> reopened obsessively.
> 
> 524641 opens with full file (87475 lines, 437375 numbers)
> 118234 opens with small file (19714 lines, 98570 numbers)
> 5997 opens with tiny file (1000 lines, 5000 numbers)

This seems perfectly normal, no bug.

If you test a minimal scene (no macros) and still find a high number of 
reopenings that would be different but i doubt it.

> So in short, the source file is opened about 5.997 times for each data line
> read. Poking through the POV source hasn't enlightened me yet. Can anyone
> explain this (the behaviour, not my failure to understand the source)?

http://www.povray.org/documentation/view/3.6.1/243/#s02_02_02_08_02

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 20 Aug. 2006)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Eric Buddington
Subject: Re: Bug? excessive opening of source file
Date: 27 Aug 2006 19:15:01
Message: <web.44f225dabef7e84aabef64010@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote:
> Eric Buddington wrote:
> > So in short, the source file is opened about 5.997 times for each data line
> > read. Poking through the POV source hasn't enlightened me yet. Can anyone
> > explain this (the behaviour, not my failure to understand the source)?
>
> http://www.povray.org/documentation/view/3.6.1/243/#s02_02_02_08_02
>
> Christoph

I was indeed calling a macro defined in the main file. #declaring the number
I needed in a separate variable instead of calling the macro speeded parsing
up in a most gratifying way, and cut the number of open()s down to 2.

I've been quite impressed (and grateful) this last week with the quality of
responses I've gotten from these groups. Thank you!

-Eric


Post a reply to this message

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