Weird slowness in rb_hash_aset

rb_hash_aset seems to be slow when used in conjunction with PQexec in
libpq

Am I overlooking something very obvious ?

thanks