Hi Steve and team,

I have checked CStyle.py and used profile module to get the time 
bottleneck, which seems it is re.search()/re.match().
Pls see attached file (getbottleneck.log) to get the detail.

Also, I investigated the ctyle.pl and the implement of regular 
expression(RE for short) in perl.
RE is implemented via C in perl while it is implemented in re.py in python.
So, it seems reasonable that the performance of CStyle.py is lower than 
ctyle.pl.
At least I think the performance of perl's RE is higher than python RE 
module.

I have writen a simple testing as:
$ cd 
/net/torp280.sfbay/export/ws/nfstest/vector/ops/src/scm/usr/src/tools/onbld/wrk/TestPerlVsPython
$ ./run_foo.ksh ../stat.c 100
stdenv | max loop: 100
stdenv |   c file: ../stat.c
stdenv | binfiles: foo.pl foo.py
stdenv |
stdout | run testing for foo.pl using ../stat.c
stdout | begin: Mon Apr 23 04:57:27 EDT 2007
stdout |   end: Mon Apr 23 04:57:28 EDT 2007
stdout |
stdout | run testing for foo.py using ../stat.c
stdout | begin: Mon Apr 23 04:57:28 EDT 2007
stdout |   end: Mon Apr 23 04:57:31 EDT 2007
stdout |
$
 From above, we can see the performance of perl's RE is 2-3 times higher 
than python's RE's.
Pls see run_foo.ksh/foo.pl/foo.py/stat.c in attachment.

Last, I have two questions here,
1. What the acceptable performance of CStyle.py in comparison with 
cstyle.pl?
2. Any other possible bottleneck of CStyle.py?
Please add your suggestion/comments, thanks!

-- 
Regards,
Vector
Swan: 80534
Tel : + 86 10 62673534

-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.pl
Type: application/x-perl
Size: 198 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/scm-migration-dev/attachments/20070423/c66b1b14/attachment.pl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.py
Type: text/x-python
Size: 522 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/scm-migration-dev/attachments/20070423/c66b1b14/attachment.py>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: run_foo.ksh
URL: 
<http://mail.opensolaris.org/pipermail/scm-migration-dev/attachments/20070423/c66b1b14/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getbottleneck.log
Type: text/x-log
Size: 5191 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/scm-migration-dev/attachments/20070423/c66b1b14/attachment.bin>

Reply via email to