I did some benchmarks for django admin app. It was fairly hard since django is good at eating exceptions (there are like 3 levels that can eat your SystemExit) which makes it hard to correctly exit application. Anyway, it seems that our ctypes is huge problem there, calling of ctypes functions eats 20% of time overall (which is fairly a lot for 1-value table). C-level benchmark does not show anything specific. Overall it's about 3x slower than cpython, which is fairly bad (it uses the same ctypes-based pysqlite). I think we should repeat this exercise after faster ctypes and see how this goes. I don't have any reasonable benchmark to try without DB, since default webpage takes 4ms to create (12 on pypy-c), but it can be some small issue that makes huge difference. (And we don't support builtin benchmarking for pypy) Cheers, fijal
Hi Maciej, On Sat, Jun 21, 2008 at 08:24:40PM +0200, Maciej Fijalkowski wrote:
application. Anyway, it seems that our ctypes is huge problem there, calling of ctypes functions eats 20% of time overall (which is fairly a lot for 1-value table).
Spending 20% of the time in ctypes is a lot, but something else is consuming even more time than ctypes itself if I believe your numbers, because in the good cases we are around 1.4x slower than CPython. So with the admin app, say that CPython takes 1 sec; we would like to take 1.4 sec; we really take 3 sec; we loose 1.6 sec somewhere, including 0.6 sec in ctypes; so we loose 1 sec somewhere else. In other words, it is more urgent to figure out where we loose 1 sec (33% of our time) than trying to reduce ctypes' 20%. A bientot, Armin.
Yes, makes sense to dig somewhere deeper. We lack a bit profiling of builtin functions, which makes it a bit tedious to compare two runs. On the other hand ctypes is a single point which is evident to consume a lot. Also, given bigger tables (like in tests) we consume way more time in ctypes than just 20%, this is minimal possible ctypes usage. Cheers, fijal On Sun, Jun 22, 2008 at 12:12 PM, Armin Rigo <arigo@tunes.org> wrote:
Hi Maciej,
On Sat, Jun 21, 2008 at 08:24:40PM +0200, Maciej Fijalkowski wrote:
application. Anyway, it seems that our ctypes is huge problem there, calling of ctypes functions eats 20% of time overall (which is fairly a lot for 1-value table).
Spending 20% of the time in ctypes is a lot, but something else is consuming even more time than ctypes itself if I believe your numbers, because in the good cases we are around 1.4x slower than CPython. So with the admin app, say that CPython takes 1 sec; we would like to take 1.4 sec; we really take 3 sec; we loose 1.6 sec somewhere, including 0.6 sec in ctypes; so we loose 1 sec somewhere else.
In other words, it is more urgent to figure out where we loose 1 sec (33% of our time) than trying to reduce ctypes' 20%.
A bientot,
Armin.
participants (2)
-
Armin Rigo
-
Maciej Fijalkowski