Get the latest tech news

The fastest way to detect a vowel in a string


Diving into CPython, bytecode, regex, and algorithmic analysis to find the fastest method.

This post involves 11 different methods of detecting a vowel, algorithmic analysis, dissembling Python bytecode, inspecting the CPython implementation, and even looking at compiled regex opcodes. The book Effective Python says,"list comprehensions are clearer than the map and filter built-in functions because they don't require lambda expressions". My beloved set intersection is plenty fast for real world use but doesn't look great in the ranking.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of string

string

Photo of Fastest way

Fastest way

Photo of vowel

vowel

Related news:

News photo

After a string of successes, early-stage fund Felicis raises fresh $900M

News photo

The Fastest Way yet to Color Graphs

News photo

Low-cost method transforms ordinary rocks into carbon dioxide storage | It's not exactly the fastest way to hoover up CO2, but the team believes it could be a relatively inexpensive affair, and can easily scale to help sort our emissions problem worldwide.