<Hodgestar>
fangerer: We also need to add the names of some of the new faces to the list of attendees, but I didn't know all of them.
<fangerer>
thanks, I'll take care of it
phlebas has quit []
phlebas has joined #hpy
<Hodgestar>
Tx.
<fangerer>
done.
Joannah has joined #hpy
joannah68 has joined #hpy
Joannah has quit [Ping timeout: 256 seconds]
<fangerer>
antocuni: As we discussed yesterday, I did a grep through the top4000 to see what C API functions are used. IIRC, you already did that before (or something similar) and just want to know how you did it. I was using `egrep -s -h -o -r '\<_?Py[0-9A-Za-z_]*\('` which will basically look for patterns like `_Py...(` (leading underscore is optional). Does that sound legitimate to you?
<antocuni>
the regexp looks good but I was never brave enough to try such an automated way of extracting all functions
<antocuni>
what I meant in the call is that when we need to decide whether to introduce a certain API or not, it might be useful to see if and how often it is used in the real world
<antocuni>
and to use top4000 as a guidance
<antocuni>
e.g. I expect things like PyList_Append and PyDict_Values to be used a lot so they should be fine to include, but maybe there are more obscure APIs which are not worth the assle
<antocuni>
there is also the case of APIs which are probably used a lot but there they have a simpler and more generic equivalent. E.g. HPyDict_Size can probably be replaced by HPy_Len
<fangerer>
sure, and I already have some results. The most frequently used _func_ is `Py_DECREF` (7148 of 79334 calls; so ~10%). While `PyList_Append` is called 279 -- 0.35 %.
<fangerer>
my question is: I'm now grepping for calls; is that the right metric? should we maybe have a metric like _used in n modules_ ?
<antocuni>
that's a good question for which I don't have an answer :)
<fangerer>
okay, I'll think about it (or wait for other opinions)
<fangerer>
btw. this is just preliminary; the list also contains functions from packages that follow the same naming scheme. For instance, `PyUFunc_FromFuncAndDataAndSignature` is not a C API function (I think it is from Numpy).
<antocuni>
yes, I also had this problem in my greps
<fangerer>
I plan to do the grep on CPython's code and then do the intersection
<antocuni>
the good news is that it seems that we already support and/or it's easy to add support for most of the most frequent functions
<fangerer>
yes
<antocuni>
and for some we already have a working alternative (e.g. PyTuple_SET_ITEM vs HPyTupleBuilder)
<fangerer>
I think Simons idea about introducing `HPy_CallMethod` is nice because this would cover a lot of very specific APIs and is also probably not too bad in terms of performance
<fangerer>
* Simon's
<fangerer>
I'll add this one (next week)
<fangerer>
have a nice weekend !
<antocuni>
well, I'm not sure about performance
<fangerer>
🙂 because you are thinking of CPython
<antocuni>
yes of course. The first goal is to avoid any overhead on CPython, else people will find excuses not to migrate :)
<fangerer>
Okay, we can always add more specific APIs
<antocuni>
yes, I think that it's ok to have things like HPyList_Append