[Tarantool-patches] [PATCH v2 11/16] sql: introduce sql_stmt_sizeof() function

Konstantin Osipov kostja.osipov at gmail.com
Fri Dec 13 17:15:20 MSK 2019


* Nikita Pettik <korablev at tarantool.org> [19/12/13 16:59]:
> > I would add size-caching right away, to make this function cheap.
> > 
> > if (size != 0)
> >     return size;
> 
> Does it make any sense? Now for one VM instance it can be called at
> most three times: twice during insertion and once during deletion.

This will make the contract this function provides more reliable.
Please keep in mind that whoever is going to use it in the future
will not read its code and not want to think about its complexity.
And the added cost will be hard to notice during a code review.

So it's less about performance and more about maintenance costs.


-- 
Konstantin Osipov, Moscow, Russia


More information about the Tarantool-patches mailing list