Re: Performance of PyUnicode Issue #2100
Jeff Allen <[email protected]>
| Newsgroups | gmane.comp.lang.jython.devel |
|---|---|
| Message-ID | <[email protected]> |
I've implemented the indexing idea now, and it makes most unicode operations on long-ish strings a lot faster, without significantly harming BMP performance. Two change sets are worth a look. (I'm pushing to Bitbucket to avoid a whole series of merges.) The first adds the idea of index translation, but accomplishes it using String methods that have to count code points: https://bitbucket.org/tournesol/jython-ja/commits/191a9854396d5ba742d4b2d3179647eb632aa6d0#Lsrc/org/python/core/PyUnicode.javaT132 That one is correct but slow. Then the second one provides the index that makes access fast. https://bitbucket.org/tournesol/jython-ja/commits/b96c8402f7baff86b86a002194a3b50d6903a04c The bug I noticed (in find) is fixed by the sequence of changes, and others I've found (replace, endswith, startswith) where arguments defining a slice were not dealt with correctly. I think I've found them all, but maybe not. A couple of other things I want to do: 1. speed up slicing, using the same technique, where easy. I'll try to resist more complex cases, like how we do strided slices, although I think there's scope. 2. positively reject strings that include lone surrogates of any kind. At present, I only catch leading surrogates without a trailing surrogate. Shout if any of this looks wrong. Jeff Jeff Allen On 02/09/2014 19:11, Jeff Allen wrote: > JMH is worth the learning curve. I have quite informative benchmarks > now for the table building and index translation. thanks for the pointer. > Jeff Allen > On 19/08/2014 08:15, Jeff Allen wrote: >> Interesting links, thanks. Caliper seems to have a good approach and >> explains itself well. I had experimented with the flags it uses to >> detect how many repeats might be needed to make recompilation stop. >> JMH looks harder to apply. (I found a tutorial elsewhere.) Overall I >> quite like that my test is in Python, but I can see uses for these >> either in the next phase and where I might have used them in the past. >> Jeff Allen >> On 17/08/2014 09:55, Indra Talip wrote: >>> Jeff, >>> Two tools that I've seen that have a reasonable reputation for being >>> able to create reliable micro benchmarks on the JVM are JMH [1] and >>> Caliper [2]. I've not used either but my understanding is that they >>> are suited to that sort of benchmarking and handle the vagaries of >>> the JIT compiler. >>> >>> [1] http://openjdk.java.net/projects/code-tools/jmh/ >>> [2] https://code.google.com/p/caliper/ >>> > > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > > > _______________________________________________ > Jython-dev mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jython-dev ------------------------------------------------------------------------------ Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk _______________________________________________ Jython-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jython-dev