Konovalov, Vadim (Vadim)** CTR ** wrote:
-----Original Message-----
From: John Cerney [mailto:jcer...@tx.rr.com]
My google login is jcer...@tx.rr.com

done.

thanks for joining :)

* All the perl/tk widget demos work with minimal changes (typically by just changing the "Use Tk;" to "Use Tcl::Tk (qw/ :perlTk /)" at the top of the file.
        
        "use Tk",  "use Tcl::Tk"

The "(qw/ :perlTk /)" is there so that syntax like "$top = MainWindow->new();" from the perl/tk script will work.

I meant lowercase "u"

Ok, I see that now.
* Tcl::Tk widget objects have been changed to be a blessed hash-ref, rather than a blessed array-ref, for compatibility with perl/tk.
        
AFAIR it was done to made widgets quicker - hash and array both quick, but array quicker, also should take less memory.
        Is converting to hash *really* unavoidable?
        
        Of course this is not the only reason why perl/Tk is slower.
        
        
I think converting to a hash was unavoidable. By doing this, much of the perl/tk code could be used as-is. I don't thinks this change by itself would affect the speed significantly, but there may be other changes I have made that could have slowed things down.

Actually some speed trade-off usually is not a very big issue.

But I wonder, is it possible to do it some interchangeable?

So if I want faster - then it will be non-compatible but array-based, otherwise 
hash-based??

And it will be easier to visually compare the speed.

It might be possible to support some array-based, fast mode, and hash-based, compatibility mode. However, I would hope that the hash-based approach could be made fast enough so that we won't have to resort to this extra complexity.

I would like to do some benchmark comparisons and profiling (using a decent profiler like Devel::DProf or Devel::NYTProf) to see how much the speed can be improved for the compatibility mode first. This will give us some real numbers to compare.
Is there some sort of benchmark test you have used to look at speed? It would be interesting to see if there is a speed penalty for these changes.

not right now :)

I just used some simple stupid stress-test http://perlmonks.org/?node_id=426089

A slightly better benchmark would be highly desired,
especially now,
when there will be Tcl::Tk for Rakudo, soon.

I'll take a look at the stress test, and maybe come up with some other benchmark tests.

* To run the demos without having to install the package, type "perl -Mblib -w widgetTclTk" on the command line.

        
this is true, but, as long as we're pure-perl, will work even
          perl -Mblib -w widgetTclTk"
        
        w/out even invoking "make"
Hmmm, this doesn't work for me (tried on win32). On a clean extract from the tar file. I run "perl Makefile.PL", then "perl -Mblib widgetTclTk". I get the error message

Cannot find blib even in C:\
BEGIN failed--compilation aborted.

my fault

perl -Ilib -w widgetTclTk"


Ok, that makes sense.


Thanks,

John

Reply via email to