Pooly wrote:
2005/9/27, Lefteris Tsintjelis <[EMAIL PROTECTED]>:

Hi,

    What makes me wonder is that the same test, with the code
stripped down, to my surprise, is significantly faster that the
multi threaded one, no matter how many times I run the tests. I am
including the code for both tests I run.
    Since I couldn't find a good example of mutex locking the
following one is something that worked for me. However, I am not
sure if its as optimized as it should be, so I would appreciate an
expert's opinion about this. Is this a good example of mutex
locking? Are there any other better ways for this? Is this an OS
or MySQL issue? I am currently running 4.1.14 on a FreeBSD5 box.


You ran several queries with multiple thread, fine, but they are all
serialised over one connection, so you get all the overhead of locking
and thread-creation, for no advantage... So that's the result
expected.
(So, yes forthe troll, it's an OS issue, threads creation are somewhat
slow on FreeBSD :)

My intention was to avoid the overhead of multiple network
connections and I didn't expect it to have that much difference. It
is probably an OS issue a bit here as well, I have to agree with
that. I will test and see what happens with a few network connections
but I have a bad feeling about this one also. I don't think it will
get much better and not even close to a non multi thread
implementation, but further tests will show. I am just curious if
anyone could run the same tests in some other OS and maybe compare
some notes. I looked around but the few things I found are doubtful.
There are no good performance tests between threads and no threads
with random access reads and writes, or maybe even better MyISAM and
InnoDB as well as threads/no threads. This should also be interesting
due to the locking differences of those two databases among other
things.

Lefteris


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to