Pathologically slow example
See original GitHub issueThe following takes 25 seconds to reformat on my machine. In comparison, many significantly larger files run in under a second:
specialElements = frozenset((
(namespaces['html'], 'address'),
(namespaces['html'], 'applet'),
(namespaces['html'], 'area'),
(namespaces['html'], 'article'),
(namespaces['html'], 'aside'),
(namespaces['html'], 'base'),
(namespaces['html'], 'basefont'),
(namespaces['html'], 'bgsound'),
(namespaces['html'], 'blockquote'),
(namespaces['html'], 'body'),
(namespaces['html'], 'br'),
(namespaces['html'], 'button'),
(namespaces['html'], 'caption'),
(namespaces['html'], 'center'),
(namespaces['html'], 'col'),
(namespaces['html'], 'colgroup'),
(namespaces['html'], 'command'),
(namespaces['html'], 'dd'),
(namespaces['html'], 'details'),
(namespaces['html'], 'dir'),
(namespaces['html'], 'div'),
(namespaces['html'], 'dl'),
(namespaces['html'], 'dt'),
(namespaces['html'], 'embed'),
(namespaces['html'], 'fieldset'),
(namespaces['html'], 'figure'),
(namespaces['html'], 'footer'),
(namespaces['html'], 'form'),
(namespaces['html'], 'frame'),
(namespaces['html'], 'frameset'),
(namespaces['html'], 'h1'),
(namespaces['html'], 'h2'),
(namespaces['html'], 'h3'),
(namespaces['html'], 'h4'),
(namespaces['html'], 'h5'),
(namespaces['html'], 'h6'),
(namespaces['html'], 'head'),
(namespaces['html'], 'header'),
(namespaces['html'], 'hr'),
(namespaces['html'], 'html'),
(namespaces['html'], 'iframe'),
# Note that image is commented out in the spec as "this isn't an
# element that can end up on the stack, so it doesn't matter,"
(namespaces['html'], 'image'),
(namespaces['html'], 'img'),
(namespaces['html'], 'input'),
(namespaces['html'], 'isindex'),
(namespaces['html'], 'li'),
(namespaces['html'], 'link'),
(namespaces['html'], 'listing'),
(namespaces['html'], 'marquee'),
(namespaces['html'], 'menu'),
(namespaces['html'], 'meta'),
(namespaces['html'], 'nav'),
(namespaces['html'], 'noembed'),
(namespaces['html'], 'noframes'),
(namespaces['html'], 'noscript'),
(namespaces['html'], 'object'),
(namespaces['html'], 'ol'),
(namespaces['html'], 'p'),
(namespaces['html'], 'param'),
(namespaces['html'], 'plaintext'),
(namespaces['html'], 'pre'),
(namespaces['html'], 'script'),
(namespaces['html'], 'section'),
(namespaces['html'], 'select'),
(namespaces['html'], 'style'),
(namespaces['html'], 'table'),
(namespaces['html'], 'tbody'),
(namespaces['html'], 'td'),
(namespaces['html'], 'textarea'),
(namespaces['html'], 'tfoot'),
(namespaces['html'], 'th'),
(namespaces['html'], 'thead'),
(namespaces['html'], 'title'),
(namespaces['html'], 'tr'),
(namespaces['html'], 'ul'),
(namespaces['html'], 'wbr'),
(namespaces['html'], 'xmp'),
(namespaces['svg'], 'foreignObject')
))
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:16 (10 by maintainers)
Top Results From Across the Web
The Abnormal EEG - NCBI Bookshelf - NCBI - NIH
Focal slow wave activity on the EEG is indicative of focal cerebral pathology of the underlying brain region. Slowing may be intermittent or...
Read more >Bradyphrenia - an overview | ScienceDirect Topics
Bradyphrenia is defined as a pathological slowing of mental processes. From: Reference Module in Neuroscience and Biobehavioral Psychology, 2017. Related terms:.
Read more >Physiological and pathological tremors and rhythmic central ...
Introduction. Tremor, defined as a rapid back-and-forth movement of a body part, is a readily apparent and easily quantified motor phenomenon found both...
Read more >bradycardia | pathology - Encyclopedia Britannica
bradycardia, type of arrhythmia (abnormal heart rhythm) characterized by slowing of the heart rate to 60 beats per minute or less.
Read more >Pathology - Definition, Meaning & Synonyms - Vocabulary.com
We also use pathology to describe abnormal conditions that aren't really diseases, like the pathology of Hollywood stars who live their lives in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
User (CPU) time running over first example above, measured at every yapf commit:
Perhaps this/these should be added as a (timed) test?