freenode/#sbcl - IRC Chatlog
Search
11:18:54
Shinmera
I did some allocation profiling with sprof on my game, and it seems to spend a very large amount of allocations within sb-alien::make-alien-single-float-type. This seems rather strange to me.
11:21:54
Shinmera
The call-with-data-ptr function is here for reference: https://github.com/Shirakumo/trial/blob/master/data-pointer.lisp#L93
12:24:31
scymtym
looks like that should mainly create an SB-ALIEN:ALIEN-SINGLE-FLOAT-TYPE instance which has four slots. i think i would just use a local cache, for example an alist in a LOAD-TIME-VALUE cell that caches either types size or fully specialized thunks, depending on how much the code besides the type size computation impacts performance
13:09:15
scymtym
i guess cffi could also install a compiler macro, but that wouldn't help with your use-case in which the type is not constant
18:15:34
Xach
What should the code here do instead of using a list? #' or something? https://github.com/zkat/sheeple/blob/7e4f27e57d5c1ef6925c164cbe788874a99da0cb/src/objects.lisp#L379
18:22:31
Xach
i ran into a nice case of type inference where the code had something like (case thing (fireball (mapcar #'frob thing))) and sbcl said "hey thing is a symbol you silly goose" and that was nice. i don't know if that's new but i enjoyed it.
18:27:25
Xach
oh, this is a nice (new?) one too: https://github.com/j3pic/lisp-binary/blob/02ce88f285ef4c8e8b3c2be3385217490fab9628/utils.lisp#L293
18:46:11
stassats
the last commit, it used to be normal setf, i guess avoiding forward referencing warnings?