Ticket #17025: tests.txt

File tests.txt, 1.6 KB (added by Anssi Kääriäinen, 12 years ago)
Line 
1Running Django's own testsuite:
2#./runtests.py --settings=test_sqlite --verbosity=0
3and then alternating between trunk and patched version
4
5Switched to branch 'master'
6Ran 4218 tests in 590.286s
7
8Switched to branch 'add_q_further'
9Ran 4218 tests in 541.701s
10
11Switched to branch 'master'
12Ran 4218 tests in 583.265s
13
14Switched to branch 'add_q_further'
15Ran 4218 tests in 562.066s
16
17Switched to branch 'master'
18Ran 4218 tests in 644.779s
19
20Switched to branch 'add_q_further'
21Ran 4218 tests in 530.566s
22
23Switched to branch 'master'
24Ran 4218 tests in 592.954s
25
26Switched to branch 'add_q_further'
27Ran 4218 tests in 539.268s
28
29Master Total: 2409
30Where Refactor: 2172
31
32Speedup about 10%
33
34A couple of test with postgresql and the following model:
35
36class User(models.Model):
37 email = models.TextField()
38
39The test file is as follows, you need to do some application setup:
40
41import settings
42from django.core.management import setup_environ
43setup_environ(settings)
44
45from test_models.models import User
46from datetime import datetime
47from django.db import transaction
48
49User.objects.create(pk=1, email='foo@bar.com')
50
51#Test 1
52start = datetime.now()
53for i in range(0, 1000):
54 User.objects.filter(pk=1)
55print datetime.now() - start
56
57#Test 2
58qs = User.objects.all()
59start = datetime.now()
60for i in range(0, 200):
61 qs = qs.filter(pk=i)
62print datetime.now() - start
63
64# Test3
65qs = User.objects.all()
66@transaction.commit_on_success
67def managed():
68 start = datetime.now()
69 for i in range(0, 1000):
70 obj = User.objects.get(pk=1)
71 obj.save()
72 print datetime.now() - start
73managed()
74
75
76
77
78
Back to Top