Thanks for your reply.
Actually, the result of without "rdtsc" is reasonable. I used perf to analyze the performance and found that
even thought the function tracking conflicts (RWConflictExists) was faster, the function inserting conflicts (SetRWConflict)
was too slower. According to your suggestion, I found there were much more waiting events of predicate_lock_manager.
That means, slower SetRWConflict resulted in more lock conflicts.
So I took some effort to made it faster in the last days.
Why the code with "rdtsc" is much faster? I thought that may be caused by some mistakes.
When I changed a machine to run the code, this phenomenon didn't happen anymore..
-----Original Messages-----
From: "Robert Haas" <robertmhaas@gmail.com>
Sent Time: 2017-07-29 02:46:47 (Saturday)
To: "Mengxing Liu" <liu-mx15@mails.tsinghua.edu.cn>
Cc: "Alvaro Herrera" <alvherre@2ndquadrant.com>, kgrittn <kgrittn@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] [GSOC] Eliminate O(N^2) scaling from rw-conflict tracking in serializable transactions
--
Sincerely
Mengxing Liu