I figured it out, and it has nothing to do with XS. I recalled that I run to this before, and at that occassion I also had a bless and tied hash, but without any XS.
The solution was to move DESTROY to the Perl code, and write it like this: sub DESTORY { my ($self) = @_; if (defined %$self) { xs_DESTROY($self); } } (And, yes, those FETCH and STORE were not too efficient. I have replaced the grep things with hash lookups. Still a factor 2 slower than non-tied, but out of laziness the XS code always read all attributes it may be interested in.) -- Erland Sommarskog, Stockholm, [EMAIL PROTECTED]