Using fixed variables probably doesn't help
John Arbash Meinel
john at arbash-meinel.com
Fri Jun 16 15:36:03 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert Collins wrote:
> On Fri, 2006-06-16 at 09:26 -0500, John Arbash Meinel wrote:
>
>
>> Sure, but that means it won't be the same string that everyone else
>> uses. So you lose the fast lookups. My point was to have the returned
>> strings be interned, so when 'walkdirs()' says 'if kind == 'unknown'
>> then stat' it doesn't have to be a string comparison.
>>
>> In my testing it was only about 10% faster, but it was faster.
>
> Is it reasonabel to do this by having osutils get the strings from the
> readdir module?
>
> If not, we can experiment with teaching the pyrex code to use interned
> strings.
>
> Rob
Well, you could replace the global variables if it can load the C extension.
But you lose the value of having all the other occurrences of 'unknown'
be interned.
You could pass the variables into the pyrex module, or you could just
call "<char*> unknown = intern('unknown')".
I would guess that would work.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEksHSJdeBCYSNAAMRAs1lAKCM8RTQpu/PlJM+AdA3o/h0+1BgKACghWHc
m9Opcioizw1OGiawLxqzg10=
=ktAM
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list