facebookincubator / cinder

Cinder is Meta's internal performance-oriented production version of CPython.
https://trycinder.com
Other
3.43k stars 122 forks source link

-X jit-enable-jit-list-wildcards has high overhead #29

Open belm0 opened 3 years ago

belm0 commented 3 years ago

The -X jit-enable-jit-list-wildcards option causes overhead of PyEntry_init to increase by 4x.

The following are measured with prof top -g -p ... on my app process.

empty jit list, wildcards disabled: Screen Shot 2021-06-17 at 11 53 08 AM

empty jit list, -X jit-enable-jit-list-wildcards: Screen Shot 2021-06-17 at 11 54 03 AM

(from discussion in #18)

belm0 commented 3 years ago

From duplicate bug:

We should at least add a comment to let people know this is not suitable for production.

The root-cause is likely O(all pattern lengths) complexity being introduced on every PyEval_LazyInit() which can be a very significant given how nested-function support currently works.