freenode/#sbcl - IRC Chatlog
Search
13:53:12
aeth
Are there any performance implications for using struct inheritance? The manual makes it seem like there aren't.
13:54:16
aeth
well e.g. generic accessor calls since the parent's accessors can be used on the child's
13:57:02
Bike
when you typep with a struct class it has to compare classes and then if that fails iterate through the cpl of the object, rather than just do the compare. i kind of doubt that's going to impact anything though.
13:57:10
Bike
since structs are single inheritance you can just have the slots at the same locations.
13:58:29
aeth
I guess it could mess with the optimal order of the slots, since the parent's slots would have to come first.
14:15:33
pfdietz
Access to standard objects, through the accessors, involves the full generic dispatch machinery, as you can write additional methods for those accessors.
14:19:11
pfdietz
Structure slot access can be inlined, since redefining structure types is undefined behavior.
14:21:26
pfdietz
It would be Really Cool to have the infrastructure to make the common case of standard objects be as fast as structures, but this would be hairy. I think it would require dynamic recompilation of functions when classes or methods on accessors changed. And if that function is in the middle of a call...
15:09:03
pfdietz
fatal: unable to access 'https://git.code.sf.net/p/sbcl/sbcl/': The requested URL returned error: 503