[REBOL] Re: Help: progress bar to slow
From: nitsch-lists:netcologne at: 21-Nov-2002 0:43
On Wed, Nov 20, 2002 at 11:27:27AM -0500, alan parman wrote:
> I have a progress bar that keeps track of the progress of an encryption/decryption
process.
>
> My problem is that updating it is extremely slow.
> A decryption that takes about 4 seconds without the progress bar takes 10 seconds with
the progress bar.
>
> I update the bar with the following function:
>
> update-progress: func [
> progress-face
> current-index
> max-index
> ][
> wait 0
> if current-index // 50 = 0 [
> progress-face/data: current-index / max-index
> show progress-face
> ]
> ]
>
> The "if current-index ..." part was included to try and speed it up, but even calling
"show" 50-times less frequently doesn't help much.
>
why base show-check on current index instead of based on progress-face/data ?
something like
d2: current-index / max-index
if d2 - 0.1 > progress-face/data[ .. ]
would reduce to 10 show in 10% - increments.
also the frequency fits display-increment better.
> The progress bar itself is as follows:
>
> display-encrypt-mode: progress "En/Decrypt Mode" 150x20 center bold 172.158.140 font-color
black font [size: 12 shadow: none] with [saved-area: true]
>
> Anyone have any ideas on why this is so slow?
> --
-volker