DAGDA SEARCH | Back to results | Support

Need for Speed / Deferred - Python Wiki

Source: https://wiki.python.org/python/performance/NeedForSpeed/Deferred.html

  1. Python Wiki /
  2. Python Wiki /
  3. Performance /
  4. Needforspeed /
  5. Need for Speed / Deferred
View as Markdown

Need for Speed / Deferred

Legacy Wiki Page

This page was migrated from the old MoinMoin-based wiki. Information may be outdated or no longer applicable. For current documentation, see python.org.

Copyless network I/O

A “hot buffer” class was implemented in order to perform I/O and parsing (using struct) without creating or copying strings around. This is compared for performance with a loop that creates strings via slices and concatenates strings. It turns out that the hot buffer version is not much faster (about the same speed) because it replaces string allocations and concatenations with dict lookup in order to access its attributes (position and limit). The version that uses strings is pretty fast since we write it using the string protocol, i.e. no dict lookup is performed. However, by implementing the common use patterns in C we should be able to make parsing of common input (e.g. netstrings) much faster. The hot buffer provides a more intuitive interface to parsing. The fact is that currently the performance gains with the initial version are not significant. (We need to complete some features to measure its impact.)

PreviousNeed for Speed / Goals / Slowdown Next Need for Speed / Failures