Updated benchmark and documentation.
This commit is contained in:
@@ -6,6 +6,9 @@ A Python binding for [Upskirt][1].
|
||||
[1]: https://github.com/tanoku/upskirt
|
||||
|
||||
|
||||
Documentation can be found at: http://pantyshot.61924.nl/
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
|
||||
@@ -5,31 +5,31 @@ try:
|
||||
import pantyshot
|
||||
except ImportError:
|
||||
pantyshot = None
|
||||
print 'Pantyshot is not available...'
|
||||
print('Pantyshot is not available...')
|
||||
|
||||
try:
|
||||
import markdown
|
||||
except ImportError:
|
||||
markdown = None
|
||||
print 'Markdown is not available...'
|
||||
print('Markdown is not available...')
|
||||
|
||||
try:
|
||||
import markdown2
|
||||
except:
|
||||
except ImportError:
|
||||
markdown2 = None
|
||||
print 'markdown2 is not available...'
|
||||
print('markdown2 is not available...')
|
||||
|
||||
try:
|
||||
import cMarkdown
|
||||
except ImportError:
|
||||
cMarkdown = None
|
||||
print 'cMarkdown is not available...'
|
||||
print('cMarkdown is not available...')
|
||||
|
||||
try:
|
||||
import discount
|
||||
except ImportError:
|
||||
discount = None
|
||||
print 'discount is not available...'
|
||||
print('discount is not available...')
|
||||
|
||||
|
||||
class Benchmark(object):
|
||||
@@ -41,7 +41,7 @@ class Benchmark(object):
|
||||
start = time.clock()
|
||||
func(*args, **kwargs)
|
||||
end = time.clock()
|
||||
print '%s: %f' % (self._name, end - start)
|
||||
print('%s: %fs' % (self._name, end - start))
|
||||
return wrapper
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ if __name__ == '__main__':
|
||||
with open('markdown-syntax.md', 'r') as fd:
|
||||
text = fd.read()
|
||||
|
||||
loops = xrange(0, 100)
|
||||
loops = range(0, 100)
|
||||
|
||||
if pantyshot:
|
||||
benchmark_pantyshot(text, loops)
|
||||
|
||||
@@ -1,7 +1,27 @@
|
||||
## Introduction
|
||||
|
||||
Pantyshot (パンチラ) is a Python (2.7 and 3.2) binding for [Upskirt][-1]. And
|
||||
Upskirt is a Markdown library written in C and it's really fast. Here is a
|
||||
[benchmark][0]:
|
||||
|
||||
Pantyshot: 0.040000s
|
||||
Markdown: 4.900000s
|
||||
markdown2: 7.210000s
|
||||
cMarkdown: 0.070000s
|
||||
discount: 0.160000s
|
||||
|
||||
Python 2.7 was used in the benchmark. I couldn't find any working Markdown
|
||||
parsers for Python 3. Is Pantyshot the only one?
|
||||
|
||||
|
||||
[-1]: https://github.com/tanoku/upskirt
|
||||
[0]: https://github.com/FSX/pantyshot/blob/master/benchmark/benchmark.py
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
Download Pantyshot from [Github][1] and run the following command. Keep in mind
|
||||
that Pantyshot has only been tested with Python 2.7.
|
||||
that Pantyshot has only been tested with Python 2.7 and 3.2.
|
||||
|
||||
python setup.py install
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Pantyshot, a Python binding for Upskirt!</title>
|
||||
<title>Pantyshot (パンチラ), a Python binding for Upskirt!</title>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
Reference in New Issue
Block a user