Permalink
Browse files

Add a performance task

  • Loading branch information...
1 parent ddde3c1 commit 2340af80884d4f416d0d7e498d378e88d8ab34cc @anthony-tresontani committed Jun 27, 2012
Showing with 5 additions and 5 deletions.
  1. +2 −0 makefile
  2. +3 −5 performance.py
View
@@ -3,3 +3,5 @@
test:
python manage.py test --settings=test_settings
+performance:
+ echo "from performance import *; test_performance()"| python manage.py shell
View
@@ -10,12 +10,10 @@ class MyCSvModel(CsvModel):
class Meta:
delimiter = ";"
-def test_performance():
+def test_performance(row=100000, cycle=10):
before = datetime.now()
- data = ['jojo; 12; 1.8']*100000
- for i in range(10):
+ data = ['jojo; 12; 1.8']*row
+ for i in range(cycle):
MyCSvModel.import_data(data=data)
after = datetime.now()
print after - before
-
-#test_performance()

0 comments on commit 2340af8

Please sign in to comment.