[Kde-pim] Review Request 116815: Optimize the address parsing by caching already parsed addresses

Vishesh Handa me at vhanda.in
Tue Jun 17 22:55:55 BST 2014



> On June 17, 2014, 11:11 a.m., Vishesh Handa wrote:
> > Ping? What's happening with this.
> 
> Milian Wolff wrote:
>     I'd also like to see Kevin's approach be done. But the threading issues must be looked into. If this code path is really executed by different threads, then the static cache would be a bad idea.
>     
>     Generally, I can just say that I've also seen ImapParser::parseParenthesizedList as _the_ hotspot in kmail nowadays, esp. during startup. It leads to an excessive amount of allocations, which probably is the source for the bad performance. Generally, I think a benchmark for that function would be helpful, so that we can look into making the function itself faster as well.
>     
>     Still, caching the results might be a good idea, esp. if the cache hit/miss ratio is high. This is something I'm missing so far from this patch. A simple test is to add a static counter for hits/misses and output them all the time as the counters increase.
> 
> Mark Gaiser wrote:
>     Hi,
>     
>     Ignore this patch as it currently is. It was based on too little knowledge about the underlying structure on my part (i know a lot more about it now). Also, the parsing logic itself was about to be changed to use streaming which would improve performance but make this patch completely useless since i would have to profile it again to see where hot spots may pop up.
>     
>     The current chain of events that i'm aware of:
>     - Dan was waiting for Guy to finish the style changes
>     - Then he could merge the branch "shared-imapstreamparser" from http://quickgit.kde.org/?p=akonadi.git
>     - and then i gladly take another good look at this.
>     
>     Millian apparently loves benchmarks, so when i take a look at it again, i will make a Q_BENCHMARK out of it. ^_-
>     
>     Dan, where do you stand on merging "shared-imapstreamparser"?

Mark. If this review request is no longer valid then please discard it.


- Vishesh


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/116815/#review60228
-----------------------------------------------------------


On March 15, 2014, 9:47 p.m., Mark Gaiser wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/116815/
> -----------------------------------------------------------
> 
> (Updated March 15, 2014, 9:47 p.m.)
> 
> 
> Review request for KDEPIM, Dan Vrátil and Vishesh Handa.
> 
> 
> Repository: kdepim-runtime
> 
> 
> Description
> -------
> 
> Profiling mail indexing showed that parsing the address line was taking up most time. Further checking showed that each address is parsed, also if it was already parsed. So i simply added a cache in between which means that addresses are only parsed if not parsed before. This should speed up indexing significantly.
> 
> In my benchmarks indexing was twice as fast as opposed to before this patch. But on git master i'm getting wildly different results. Still faster, but just about 20%.
> 
> 
> Diffs
> -----
> 
>   plugins/akonadi_serializer_mail.cpp a6ac4b8 
> 
> Diff: https://git.reviewboard.kde.org/r/116815/diff/
> 
> 
> Testing
> -------
> 
> All tests pass just fine.
> 
> 
> Thanks,
> 
> Mark Gaiser
> 
>

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list