Opened 20 years ago
Closed 19 years ago
#966 closed enhancement (wontfix)
tracd should probably use psyco if available
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | lowest | Milestone: | |
Component: | general | Version: | 0.8 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Psyco improves execution speed of average Python programs a lot. Especially for number-crunching/string-handling stuff I've found it immensely valuable (for example, my gcov-replacement gets 50x speed increase with Psyco - it changes my Python code from completely useless to almost GCC's own C-written gcov's speed).
Anyway, enough digression. Psyco support is trivial - I changed the tracd's main as follows:
if __name__ == '__main__': try: import psyco psyco.profile() except ImportError: pass main()
.. and it just works(tm). At least so me :)
Attachments (0)
Change History (5)
comment:1 by , 20 years ago
comment:2 by , 20 years ago
Well, my tracd-usage case at least seemed faster, but haven't had motivation to make reproducible benchmark (I have http-recorder tool but too lazy to use it _)
comment:3 by , 20 years ago
I just gave another try to the newly released psyco-1.3
,
and I can observe a strange side-effect: the diffs are not generated
anymore for changesets.
I didn't investigate very much, but it's definetly psyco related (adding/removing psyco.full() from tracd shows/removes the bug).
The only hint I have is the following that gets written on the console:
diff: /tmp/tmpeeq6JO: No such file or directory diff: /tmp/tmpmMUEh5: No such file or directory diff: /tmp/tmpDD5SG6: No such file or directory diff: /tmp/tmpizfPH9: No such file or directory
(there were 2 files in the changeset)
comment:4 by , 20 years ago
A downside that should be considered is the potentially large increase memory usage when Pysco is used. For server processes, keeping memory usage to a relatively low and stable level is usually desirable.
comment:5 by , 19 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Yeah, psyco is not a particularly effective way of optimizing Trac. If tracd is really too slow for you, trying other setups like lighttpd+FastCGI would be more effective.
I tried Psyco several months ago. While it is true that it can be pretty impressive on some programs (i.e. those involving heavy computations done in Python), it didn't seem to help a lot in the case of Trac. I even found it to be (slightly) slower…
The reason for this is that Trac takes the speed benefit of having a lot of C components (Clearsilver, SQLite, …) that do most of the time consuming tasks.
One area where Psyco could help would be for the reStructured Text processing, and SilverCity processing.
Have you some benchmarks?