This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients methane, pitrou, python-dev, serhiy.storchaka, vstinner, yselivanov
Date 2016-11-15.15:50:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Serhiy Storchaka:
>> * json: scanstring_unicode()
> This doesn't look wise. This is specific to single extension module and perhaps to single particular benchmark. Most Python code don't use json at all.

Well, I tried different things to make these benchmarks more stable. I didn't say that we should merge hot3.patch as it is :-) It's just an attempt.

> What is the top of "perf report"?

For json_loads, it's:

 14.99%  scanstring_unicode
  8.34%  python                                 _PyUnicode_FromUCS1
  8.32%  scan_once_unicode
  8.01%  python                                 lookdict_unicode_nodummy
  6.72%  python                                 siphash24
  4.45%  python                                 PyDict_SetItem
  4.26%  python                                 _PyObject_Malloc
  3.38%  python                                 _PyEval_EvalFrameDefault
  3.16%  python                                 _Py_HashBytes
  2.72%  python                                 PyUnicode_New
  2.36%  python                                 PyLong_FromString
  2.25%  python                                 _PyObject_Free
  2.02%                           __memcpy_sse2_unaligned
  1.61%  python                                 PyDict_GetItem
  1.40%  python                                 dictresize
  1.24%  python                                 unicode_hash
  1.11%                           _int_malloc
  1.07%  python                                 unicode_dealloc
  1.00%  python                                 free_keys_object

Result produced with:

   $ perf record ./python ~/performance/performance/benchmarks/ --worker -v -l 128 -w0 -n 100                                                                  
   $ perf report                          

> How this list intersects with the list of functions in section of PGO build?

I checked which functions are considered as "hot" by a PGO build: I found more than 2,000 functions... I'm not interested to tag so many functions with _Py_HOT_FUNCTIONS. I would prefer to only tag something like the top 10 or top 25 functions.

I don't know the recommandations to tag functions as hot. I guess that what matters is the total size of hot functions. Should I be smaller than the L2 cache? Smaller than the L3 cache? I'm talking about instructions, but data share also these caches...

> Make several PGO builds (perhaps on different computers). Is section stable?

In my experience PGO builds don't provide stable performances, but I was never able to write an article on that because of so many bugs :-)
Date User Action Args
2016-11-15 15:50:33vstinnersetrecipients: + vstinner, pitrou, methane, python-dev, serhiy.storchaka, yselivanov
2016-11-15 15:50:33vstinnersetmessageid: <>
2016-11-15 15:50:33vstinnerlinkissue28618 messages
2016-11-15 15:50:33vstinnercreate