Re: [Cython] About IndexNode and unicode[index]

2013-03-03 Thread Zaur Shibzukhov
2013/3/2 Stefan Behnel : > Stefan Behnel, 28.02.2013 22:16: > > https://github.com/scoder/cython/commit/cc4f7daec3b1f19b5acaed7766e2b6f86902ad94 > > Stefan > I tried to build with that change. Tests `unicode_indexing` and `index` are passed. ___ cython-de

Re: [Cython] About IndexNode and unicode[index]

2013-03-02 Thread Stefan Behnel
Zaur Shibzukhov, 02.03.2013 18:55: > 2013/3/2 Stefan Behnel: >>> I think you could even pass in two flags, one for wraparound and one for >>> boundscheck, and then just evaluate them appropriately in the existing "if" >>> tests above. That should allow both features to be supported independently >>

Re: [Cython] About IndexNode and unicode[index]

2013-03-02 Thread Zaur Shibzukhov
2013/3/2 Stefan Behnel : >> I think you could even pass in two flags, one for wraparound and one for >> boundscheck, and then just evaluate them appropriately in the existing "if" >> tests above. That should allow both features to be supported independently >> in a fast way. > > https://github.com/

Re: [Cython] About IndexNode and unicode[index]

2013-03-02 Thread Stefan Behnel
Stefan Behnel, 28.02.2013 22:16: > ZS, 28.02.2013 21:07: >> 2013/2/28 Stefan Behnel: This allows to write unicode text parsing code almost at C speed mostly in python (+ .pxd defintions). >>> >>> I suggest simply adding a constant flag argument to the existing function >>> that states if

Re: [Cython] About IndexNode and unicode[index]

2013-03-02 Thread Stefan Behnel
Robert Bradshaw, 01.03.2013 09:25: > On Thu, Feb 28, 2013 at 10:54 PM, Zaur Shibzukhov wrote: > I think you could even pass in two flags, one for wraparound and one for > boundscheck, and then just evaluate them appropriately in the existing > "if" > tests above. That should allow

Re: [Cython] About IndexNode and unicode[index]

2013-03-01 Thread Zaur Shibzukhov
2013/3/1 Stefan Behnel : > Zaur Shibzukhov, 01.03.2013 10:46: >> Could I help in order to include this in 19.0? > > I like pull requests. ;) > OK ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel

Re: [Cython] About IndexNode and unicode[index]

2013-03-01 Thread Stefan Behnel
Zaur Shibzukhov, 01.03.2013 10:46: > Could I help in order to include this in 19.0? I like pull requests. ;) Stefan ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel

Re: [Cython] About IndexNode and unicode[index]

2013-03-01 Thread Zaur Shibzukhov
2013/3/1 Stefan Behnel : > ZS, 28.02.2013 21:07: >> 2013/2/28 Stefan Behnel: This allows to write unicode text parsing code almost at C speed mostly in python (+ .pxd defintions). >>> >>> I suggest simply adding a constant flag argument to the existing function >>> that states if checking

Re: [Cython] About IndexNode and unicode[index]

2013-03-01 Thread Robert Bradshaw
On Thu, Feb 28, 2013 at 10:54 PM, Zaur Shibzukhov wrote: I think you could even pass in two flags, one for wraparound and one for boundscheck, and then just evaluate them appropriately in the existing "if" tests above. That should allow both features to be supported independent

Re: [Cython] About IndexNode and unicode[index]

2013-03-01 Thread Zaur Shibzukhov
>> Then it can simplify writing utility code in order to support >> different optimization flags in other cases too. > > Usually, yes. Look at the dict iteration code, for example, which makes > pretty heavy use of it. > > This may not work in all cases, because the C compiler can decide to *not* >

Re: [Cython] About IndexNode and unicode[index]

2013-03-01 Thread Stefan Behnel
Zaur Shibzukhov, 01.03.2013 07:54: I think you could even pass in two flags, one for wraparound and one for boundscheck, and then just evaluate them appropriately in the existing "if" tests above. That should allow both features to be supported independently in a fast way.

Re: [Cython] About IndexNode and unicode[index]

2013-02-28 Thread Stefan Behnel
Zaur Shibzukhov, 01.03.2013 08:37: > unicode_slice.h > - > > #include "unicodeobject.h" > > static inline PyObject* unicode_slice( > PyObject* text, Py_ssize_t start, Py_ssize_t stop); > > /// PyUnicode_Substring /// > > /* CURRENT */ > >

Re: [Cython] About IndexNode and unicode[index]

2013-02-28 Thread Zaur Shibzukhov
2013/3/1 ZS : > 2013/3/1 Stefan Behnel : >> ZS, 28.02.2013 21:07: >>> 2013/2/28 Stefan Behnel: > This allows to write unicode text parsing code almost at C speed > mostly in python (+ .pxd defintions). I suggest simply adding a constant flag argument to the existing function

Re: [Cython] About IndexNode and unicode[index]

2013-02-28 Thread Zaur Shibzukhov
>>> >>> I think you could even pass in two flags, one for wraparound and one for >>> boundscheck, and then just evaluate them appropriately in the existing "if" >>> tests above. That should allow both features to be supported independently >>> in a fast way. >>> >> Intresting, could C compilers in

Re: [Cython] About IndexNode and unicode[index]

2013-02-28 Thread Stefan Behnel
ZS, 01.03.2013 07:43: > 2013/3/1 Stefan Behnel: >> ZS, 28.02.2013 21:07: >>> 2013/2/28 Stefan Behnel: > This allows to write unicode text parsing code almost at C speed > mostly in python (+ .pxd defintions). I suggest simply adding a constant flag argument to the existing functio

Re: [Cython] About IndexNode and unicode[index]

2013-02-28 Thread ZS
2013/3/1 Stefan Behnel : > ZS, 28.02.2013 21:07: >> 2013/2/28 Stefan Behnel: This allows to write unicode text parsing code almost at C speed mostly in python (+ .pxd defintions). >>> >>> I suggest simply adding a constant flag argument to the existing function >>> that states if checking

Re: [Cython] About IndexNode and unicode[index]

2013-02-28 Thread ZS
2013/3/1 Stefan Behnel : > ZS, 28.02.2013 21:07: >> 2013/2/28 Stefan Behnel: This allows to write unicode text parsing code almost at C speed mostly in python (+ .pxd defintions). >>> >>> I suggest simply adding a constant flag argument to the existing function >>> that states if checking

Re: [Cython] About IndexNode and unicode[index]

2013-02-28 Thread Stefan Behnel
ZS, 28.02.2013 21:07: > 2013/2/28 Stefan Behnel: >>> This allows to write unicode text parsing code almost at C speed >>> mostly in python (+ .pxd defintions). >> >> I suggest simply adding a constant flag argument to the existing function >> that states if checking should be done or not. Inlining

Re: [Cython] About IndexNode and unicode[index]

2013-02-28 Thread ZS
2013/2/28 Stefan Behnel : >> This allows to write unicode text parsing code almost at C speed >> mostly in python (+ .pxd defintions). > > I suggest simply adding a constant flag argument to the existing function > that states if checking should be done or not. Inlining will let the C > compiler dr

Re: [Cython] About IndexNode and unicode[index]

2013-02-28 Thread Stefan Behnel
ZS, 28.02.2013 19:31: > 2013/2/28 ZS: >> Looking into IndexNode class in ExprNode.py I have seen a possibility >> for addition of more fast code path for unicode[index] as it done in >> method `generate_setitem_code` in case of lists. >> >> This is files for evaluation of performance difference: >

Re: [Cython] About IndexNode and unicode[index]

2013-02-28 Thread ZS
2013/2/28 ZS : > Looking into IndexNode class in ExprNode.py I have seen a possibility > for addition of more fast code path for unicode[index] as it done in > method `generate_setitem_code` in case of lists. > > This is files for evaluation of performance difference: > > unicode_index.h > >