IRC logs of #tryton for Thursday, 2010-09-23 #tryton log beginning Thu Sep 23 00:00:01 CEST 2010
-!- sharoon(~sharoon@ has joined #tryton01:08
-!- ikks(~ikks@ has joined #tryton03:19
-!- yangoon( has joined #tryton05:18
-!- mfladischer(~fladische@2001:470:1f0b:11df:943e:37ff:fe75:aa0e) has joined #tryton07:40
-!- Timitos(~kp@ has joined #tryton07:53
-!- Timitos(~kp@ has left #tryton07:53
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton08:15
-!- sharoon(~sharoon@ has joined #tryton08:15
-!- eLBati(~elbati@ has joined #tryton08:32
-!- vladimir(~vladimir@ has joined #tryton08:43
-!- fladi_(~fladische@2001:470:1f0b:11df:943e:37ff:fe75:aa0e) has joined #tryton08:46
-!- enlightx( has joined #tryton09:16
-!- cedk( has joined #tryton09:29
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton09:29
-!- bechamel( has joined #tryton09:43
-!- mfladischer(~fladische@2001:470:1f0b:11df:943e:37ff:fe75:aa0e) has joined #tryton09:53
-!- enlightx( has joined #tryton09:56
-!- vladimir_(~vladimir@ has joined #tryton10:00
-!- svaksha(~svaksha@unaffiliated/svaksha) has joined #tryton11:10
-!- paepke( has joined #tryton11:47
cedksharoon: you pinged me yesterday11:51
sharooncedk: yes, it was about the read API performance improvement11:51
sharooncedk: one min11:52
sharooncedk: looking at the whole data, we cannot use namedtuples because they cannot be pickled11:53
sharooncedk: so i have built a custom datastructure subclassing list11:54
sharooncedk: it is faster than list of dict and occupies much lesser space11:54
cedksharoon: what is the issue with pickle?11:57
sharooncedk: the pickle protocol needs the class/object to first create an instance and then set its state11:58
sharooncedk: in the case of namedtuples, this cannot be done because it acts as a class factory and the created class has no reference in a module in applications similar to ours11:59
sharooncedk: so pickling on server side and then unpickling on client side is impossible11:59
cedksharoon: just pass a tuple12:02
bechamelcedk: how the client will re-map each tuple position with a field name ?12:03
sharooncedk: the __reduce__ method for the new pickle protocol is not capable of doing it too, i already checked that12:03
cedkbechamel: it is the order of the field readed12:04
bechamelsharoon: to pickle namedtuple, I have found this:
-!- lem0na(~lem0na@ has joined #tryton12:19
sharoonbechamel: thanks, will try but we still have quite a few issues to resolve... like the _ prefix in _datetime12:22
sharooncedk: bechamel: will put forward both the solutions12:23
-!- eLBati(~elbati@ has joined #tryton13:08
-!- paepke( has joined #tryton13:21
-!- vladimir_(~vladimir@ has joined #tryton13:39
-!- eLBati(~elbati@ has joined #tryton14:53
cedksharoon: I still don't understand why namedtuple could not work (except for '_')15:37
sharooncedk: i got pickled in my test code because both name of element and the name of namedtuuple is same + its a global in known namespace15:39
sharooncedk: it wont pickle in a different thread/file15:39
cedksharoon: you should pickle in list of tuple15:39
sharooncedk: which means a custom pickler15:41
cedksharoon: yes15:41
sharooncedk: i will try and update here again15:44
-!- digitalsatori(~tony@ has joined #tryton15:44
sharooncedk: i am sure it will be slower because we have to subclass python pickle, not cpickle15:45
cedksharoon: in fact, I think this become too complicated15:49
cedksharoon: I'm thinking that we should just use list of tuple15:50
sharooncedk: ideal according to me15:50
cedksharoon: it is free to the reader to use or not namedtuple15:50
sharooncedk: exactly15:50
sharooncedk: only problem is where read method has been overwritten15:51
cedksharoon: it would be great to use namedtuple because it is in Python base but if it bring more issues then it solves then we should leave it15:51
sharooncedk: also i think the gzip_threshold is too low15:53
sharooncedk: gzip seems to be very slow, esp for small requsts?15:53
cedksharoon: we don't zip small request15:55
-!- pepeu(~manuel@ has joined #tryton15:55
sharooncedk: but 1400 seems to be too low?15:56
-!- paepke( has joined #tryton15:57
sharooncedk: coming back to the discussion about read method, i suggest that we go for list of tuples, improve the performance there15:58
cedksharoon: 1400 is common MTU15:59
cedksharoon: agree, normally read is only use internaly in trytond/model and in client15:59
sharooncedk: users who want to creatively use the read data for their custom apps could build dictionaries or if performance is key, build something like i built for their custom apps?16:00
cedksharoon: best is to use namedtuple :-)16:01
sharooncedk: this could be easily done from a list of tuple thats returned16:01
cedksharoon: with a map16:01
cedksharoon: like in the example
sharooncedk: i understand you like named tuples ;) BTW, there could be one last thing to do, that is using __getnewargs__16:02
cedksharoon: don't know about getnewargs16:02
sharooncedk: the thought is, using __reduce__ for pickling and returning namedtuple itself as a class instance16:03
sharooncedk: let me check16:03
sharooncedk: i will tryt and get back16:04
sharooncedk: ping16:35
cedksharoon: pong16:36
sharooncedk: namedtuples cannot be implemented because there would be absolutely no way of regenerating them on the client side :(16:37
cedksharoon: no problem let's go with list of tuples16:38
sharooncedk: ok16:38
cedksharoon: I think you did not understand me16:38
cedkI think that a programmer inside tryton could get namedtuple from read if he wants16:38
cedkit will be very simple16:38
sharooncedk: that is simple16:39
cedksharoon: so let's go with list of tuple16:40
cedksharoon: it will be great to have it for 1.816:40
sharooncedk: yep16:40
-!- gremly(~gremly@ has joined #tryton16:42
sharooncedk: we need to get easy_install trytond=dev to get to work!16:47
-!- digitalsatori(~tony@ has joined #tryton17:10
-!- sharoon(~sharoon@ has joined #tryton17:43
-!- pheller( has joined #tryton17:46
cedksharoon: don't understand18:05
sharooncedk: can we have a sudo easy_install trytond=dev to install the development version?18:06
cedksharoon: is it not working?18:09
cedksharoon: fill an issue18:09
sharooncedk: sure18:09
-!- chrue( has joined #tryton18:28
-!- pheller( has joined #tryton19:01
-!- eLBati(~elbati@ has joined #tryton19:38
-!- enlightx( has joined #tryton19:44
-!- pheller( has joined #tryton20:01
-!- pheller_( has joined #tryton20:03
-!- pheller__( has joined #tryton20:04
-!- fares(~fares@ has joined #tryton20:05
-!- sharkcz(~sharkcz@2001:15c0:6747:160::6) has joined #tryton20:20
-!- pheller( has joined #tryton20:25
-!- eLBati(~elbati@ has joined #tryton21:17
-!- pheller_( has joined #tryton21:59
-!- fares(~fares@ has joined #tryton22:45
-!- fares(~fares@ has joined #tryton22:45
-!- sharoon(~sharoon@ has joined #tryton23:25
-!- pheller(~pheller@2002:ad30:d8c3:0:fa1e:dfff:fee6:aabf) has joined #tryton23:32

Generated by 2.11.0 by Marius Gedminas - find it at!