close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "darcs": Can't find an appropriate component, maybe the corresponding plugin was not enabled? ). Look in the Trac log for more information.
- Timestamp:
-
2010-07-20 03:14:51 (14 years ago)
- Author:
-
zooko
- Comment:
-
correct names and also naïve
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v13
|
v14
|
|
18 | 18 | This works fine as long as the total amount of bytes accumulated and the number of separate {{{add_data()}}} events stay small, but it has O(N^2^) behavior and has bad performance if those numbers get large. Here are some benchmarks generated by running {{{python -OOu -c 'from stringchain.bench import bench; bench.quick_bench()'}}} as instructed by [source:README.txt the README.txt file]. |
19 | 19 | |
20 | | The {{{N:}}} in the left-hand column is how many bytes were in the test dataset. The {{{ave rate:}}} number in the right-hand column is how many bytes per second were processed. "naive" means the string-based idiom sketched above and "strch" means using the !StringChain class. |
| 20 | The {{{N:}}} in the left-hand column is how many bytes were in the test dataset. The {{{ave rate:}}} number in the right-hand column is how many bytes per second were processed. "Stringy" means the string-based idiom sketched above and "!StringChain" means using the !StringChain class. "StringIOy" means another implementation using the cStringIO class. |
21 | 21 | |
22 | 22 | {{{ |
… |
… |
|
90 | 90 | }}} |
91 | 91 | |
92 | | The naive approach is slower than the !StringChain class, and the bigger the dataset the slower it goes. The !StringChain class is fast and also it is scalable (with regard to these benchmarks at least...). |
| 92 | The naïve approach is slower than the !StringChain class, and the bigger the dataset the slower it goes. The !StringChain class is fast and also it is scalable (with regard to these benchmarks at least...). |
93 | 93 | |
94 | 94 | Okay how do you use it? It is very simple -- see [source:stringchain/stringchain.py] and let me know if that interface doesn't fit your use case. |