Hi folks: Me and the rest of the team is developing SqueakDBX which is a driver to talk with major databases. However, I think the most persistence alternatives pharo has, the best. There is no better solution for every escenario. So, I am also trying to get the PostgreSQL native driver to work in Pharo. This package depends on Cryptography because of MD5. I know that there were added to Pharo packages like System-Hashing-core, System-Hashing-SHA1 and System-Hashing-MD5. However, the driver doesn't work yet. But adding this single method:
ByteArray>>hex | stream | stream _ '' writeStream. self do: [ :each | stream nextPut: ('0123456789ABCDEF' at: each // 16 + 1); nextPut: ('0123456789ABCDEF' at: each \\ 16 + 1)]. ^ stream contents The driver works like a charm in Pharo without needing Cryptography package. As far as I remember there were no MIT problem with this package. Because of this those packages ( System-Hashing-core, System-Hashing-SHA1 and System-Hashing-MD5) were integrated in Pharo. So, can I add it? Thanks Mariano _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Sorry, I forgot to say that others classes like Integer, Float and Character are already implementing the message hex.
Best, Mariano On Wed, Aug 12, 2009 at 8:26 PM, Mariano Martinez Peck <[hidden email]> wrote: Hi folks: Me and the rest of the team is developing SqueakDBX which is a driver to talk with major databases. However, I think the most persistence alternatives pharo has, the best. There is no better solution for every escenario. So, I am also trying to get the PostgreSQL native driver to work in Pharo. This package depends on Cryptography because of MD5. I know that there were added to Pharo packages like System-Hashing-core, System-Hashing-SHA1 and System-Hashing-MD5. However, the driver doesn't work yet. But adding this single method: _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Yes, please create an entry in the bug tracker (just copy paste the
mail below should be sufficient). Cheers, Adrian On Aug 13, 2009, at 01:29 , Mariano Martinez Peck wrote: > Sorry, I forgot to say that others classes like Integer, Float and > Character > are already implementing the message hex. > > Best, > > Mariano > > On Wed, Aug 12, 2009 at 8:26 PM, Mariano Martinez Peck < > [hidden email]> wrote: > >> Hi folks: Me and the rest of the team is developing SqueakDBX which >> is a >> driver to talk with major databases. However, I think the most >> persistence >> alternatives pharo has, the best. There is no better solution for >> every >> escenario. So, I am also trying to get the PostgreSQL native driver >> to work >> in Pharo. This package depends on Cryptography because of MD5. I >> know that >> there were added to Pharo packages like System-Hashing-core, >> System-Hashing-SHA1 and System-Hashing-MD5. However, the driver >> doesn't work >> yet. But adding this single method: >> >> ByteArray>>hex >> | stream | >> stream _ '' writeStream. >> self do: [ :each | >> stream >> nextPut: ('0123456789ABCDEF' at: each // 16 + 1); >> nextPut: ('0123456789ABCDEF' at: each \\ 16 + 1)]. >> ^ stream contents >> >> The driver works like a charm in Pharo without needing Cryptography >> package. As far as I remember there were no MIT problem with this >> package. >> Because of this those packages ( System-Hashing-core, System- >> Hashing-SHA1 >> and System-Hashing-MD5) were integrated in Pharo. >> >> So, can I add it? >> >> Thanks >> >> Mariano >> > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Mariano Martinez Peck
add a nice method comment and a couple of tests!
Stef On Aug 13, 2009, at 1:26 AM, Mariano Martinez Peck wrote: > Hi folks: Me and the rest of the team is developing SqueakDBX which > is a driver to talk with major databases. However, I think the most > persistence alternatives pharo has, the best. There is no better > solution for every escenario. So, I am also trying to get the > PostgreSQL native driver to work in Pharo. This package depends on > Cryptography because of MD5. I know that there were added to Pharo > packages like System-Hashing-core, System-Hashing-SHA1 and System- > Hashing-MD5. However, the driver doesn't work yet. But adding this > single method: > > ByteArray>>hex > | stream | > stream _ '' writeStream. > self do: [ :each | > stream > nextPut: ('0123456789ABCDEF' at: each // 16 + 1); > nextPut: ('0123456789ABCDEF' at: each \\ 16 + 1)]. > ^ stream contents > > The driver works like a charm in Pharo without needing Cryptography > package. As far as I remember there were no MIT problem with this > package. Because of this those packages ( System-Hashing-core, > System-Hashing-SHA1 and System-Hashing-MD5) were integrated in Pharo. > > So, can I add it? > > Thanks > > Mariano > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Please also use (String new: (self size * 2)) writeStream instead of
'' writeStream. In this case it won't lead to any noticeable performance increases, but it's good practice anyways :) I'd also argue the expected returnvalue of "hex" might not be clear as something like "asHexString" when applied to a collection (hex previously only implemented on single values), but that's a minor issue. When looking around, I also noticed WriteStream nextPut: does an unnecessary check for ByteStrings which is pretty ugly (plus, it decreases nextPut: performance for all ByteString writeStreams), filed as Issue 1065. Cheers, Henry Issue 1065 On Aug 13, 2009, at 10:32 19AM, Stéphane Ducasse wrote: > add a nice method comment and a couple of tests! > > Stef > > On Aug 13, 2009, at 1:26 AM, Mariano Martinez Peck wrote: > >> Hi folks: Me and the rest of the team is developing SqueakDBX which >> is a driver to talk with major databases. However, I think the most >> persistence alternatives pharo has, the best. There is no better >> solution for every escenario. So, I am also trying to get the >> PostgreSQL native driver to work in Pharo. This package depends on >> Cryptography because of MD5. I know that there were added to Pharo >> packages like System-Hashing-core, System-Hashing-SHA1 and System- >> Hashing-MD5. However, the driver doesn't work yet. But adding this >> single method: >> >> ByteArray>>hex >> | stream | >> stream _ '' writeStream. >> self do: [ :each | >> stream >> nextPut: ('0123456789ABCDEF' at: each // 16 + 1); >> nextPut: ('0123456789ABCDEF' at: each \\ 16 + 1)]. >> ^ stream contents >> >> The driver works like a charm in Pharo without needing Cryptography >> package. As far as I remember there were no MIT problem with this >> package. Because of this those packages ( System-Hashing-core, >> System-Hashing-SHA1 and System-Hashing-MD5) were integrated in Pharo. >> >> So, can I add it? >> >> Thanks >> >> Mariano >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
thanks henrik
Stef On Aug 13, 2009, at 12:47 PM, Henrik Johansen wrote: > Please also use (String new: (self size * 2)) writeStream instead of > '' writeStream. > In this case it won't lead to any noticeable performance increases, > but it's good practice anyways :) > > I'd also argue the expected returnvalue of "hex" might not be clear as > something like "asHexString" when applied to a collection (hex > previously only implemented on single values), but that's a minor > issue. > > When looking around, I also noticed WriteStream nextPut: does an > unnecessary check for ByteStrings which is pretty ugly (plus, it > decreases nextPut: performance for all ByteString writeStreams), filed > as Issue 1065. > > Cheers, > Henry > > > Issue 1065 > On Aug 13, 2009, at 10:32 19AM, Stéphane Ducasse wrote: > >> add a nice method comment and a couple of tests! >> >> Stef >> >> On Aug 13, 2009, at 1:26 AM, Mariano Martinez Peck wrote: >> >>> Hi folks: Me and the rest of the team is developing SqueakDBX which >>> is a driver to talk with major databases. However, I think the most >>> persistence alternatives pharo has, the best. There is no better >>> solution for every escenario. So, I am also trying to get the >>> PostgreSQL native driver to work in Pharo. This package depends on >>> Cryptography because of MD5. I know that there were added to Pharo >>> packages like System-Hashing-core, System-Hashing-SHA1 and System- >>> Hashing-MD5. However, the driver doesn't work yet. But adding this >>> single method: >>> >>> ByteArray>>hex >>> | stream | >>> stream _ '' writeStream. >>> self do: [ :each | >>> stream >>> nextPut: ('0123456789ABCDEF' at: each // 16 + 1); >>> nextPut: ('0123456789ABCDEF' at: each \\ 16 + 1)]. >>> ^ stream contents >>> >>> The driver works like a charm in Pharo without needing Cryptography >>> package. As far as I remember there were no MIT problem with this >>> package. Because of this those packages ( System-Hashing-core, >>> System-Hashing-SHA1 and System-Hashing-MD5) were integrated in >>> Pharo. >>> >>> So, can I add it? >>> >>> Thanks >>> >>> Mariano >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Henrik Sperre Johansen
Ok. I opened the ticket: http://code.google.com/p/pharo/issues/detail?id=1067
I replaced _ to := and take into considerations the henrik suggestions. Best, Mariano On Thu, Aug 13, 2009 at 9:47 AM, Henrik Johansen <[hidden email]> wrote: Please also use (String new: (self size * 2)) writeStream instead of _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
I added a version to the issue which is almost 2x faster (for large ByteArrays at least). I'm not sure if the needs of DBX are such that the performance increase can justify the added uglyness (using to:do: instead of do: ), but it'd be nice if you would have a look.
Cheers, Henry On Aug 13, 2009, at 3:23 08PM, Mariano Martinez Peck wrote: Ok. I opened the ticket: http://code.google.com/p/pharo/issues/detail?id=1067 _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
2009/8/14 Henrik Johansen <[hidden email]>
Henry: Thanks for your feedback and work! I tried both solutions. The one I posted, with your benchmark give me 34734. However, with your version, I have 29675. best, Mariano
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Strange, retested now.
With .cs from 1065 also installed I got (first result with what I posted): Time millisecondsToRun: [500 timesRepeat: [largestByteArray hex]] 23267 32033 and without it: Time millisecondsToRun: [500 timesRepeat: [largestByteArray hex]] 38877 50751 Guess I tested the old version in an image without 1065 when I wrote the 2x :) Cheers, Henry On Aug 14, 2009, at 3:18 58PM, Mariano Martinez Peck wrote:
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Ok then...can I commit it in inbox?
best, Mariano 2009/8/14 Henrik Johansen <[hidden email]>
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
sure!
and you open a ticket flagged as 1.0 Stef On Aug 15, 2009, at 9:01 PM, Mariano Martinez Peck wrote: > Ok then...can I commit it in inbox? > > best, > > Mariano > > 2009/8/14 Henrik Johansen <[hidden email]> > Strange, retested now. > > With .cs from 1065 also installed I got (first result with what I > posted): > Time millisecondsToRun: [500 timesRepeat: [largestByteArray hex]] > 23267 32033 > > and without it: > Time millisecondsToRun: [500 timesRepeat: [largestByteArray hex]] > 38877 50751 > > Guess I tested the old version in an image without 1065 when I wrote > the 2x :) > > Cheers, > Henry > > On Aug 14, 2009, at 3:18 58PM, Mariano Martinez Peck wrote: > >> >> >> 2009/8/14 Henrik Johansen <[hidden email]> >> I added a version to the issue which is almost 2x faster (for large >> ByteArrays at least). I'm not sure if the needs of DBX are such >> that the performance increase can justify the added uglyness (using >> to:do: instead of do: ), but it'd be nice if you would have a look. >> >> Henry: Thanks for your feedback and work! I tried both solutions. >> The one I posted, with your benchmark give me 34734. However, with >> your version, I have 29675. >> >> best, >> >> Mariano >> >> >> Cheers, >> Henry >> >> On Aug 13, 2009, at 3:23 08PM, Mariano Martinez Peck wrote: >> >>> Ok. I opened the ticket: http://code.google.com/p/pharo/issues/detail?id=1067 >>> >>> I replaced _ to := and take into considerations the henrik >>> suggestions. >>> >>> Best, >>> >>> Mariano >>> >>> On Thu, Aug 13, 2009 at 9:47 AM, Henrik Johansen <[hidden email] >>> > wrote: >>> Please also use (String new: (self size * 2)) writeStream instead of >>> '' writeStream. >>> In this case it won't lead to any noticeable performance increases, >>> but it's good practice anyways :) >>> >>> I'd also argue the expected returnvalue of "hex" might not be >>> clear as >>> something like "asHexString" when applied to a collection (hex >>> previously only implemented on single values), but that's a minor >>> issue. >>> >>> When looking around, I also noticed WriteStream nextPut: does an >>> unnecessary check for ByteStrings which is pretty ugly (plus, it >>> decreases nextPut: performance for all ByteString writeStreams), >>> filed >>> as Issue 1065. >>> >>> Cheers, >>> Henry >>> >>> >>> Issue 1065 >>> On Aug 13, 2009, at 10:32 19AM, Stéphane Ducasse wrote: >>> >>> > add a nice method comment and a couple of tests! >>> > >>> > Stef >>> > >>> > On Aug 13, 2009, at 1:26 AM, Mariano Martinez Peck wrote: >>> > >>> >> Hi folks: Me and the rest of the team is developing SqueakDBX >>> which >>> >> is a driver to talk with major databases. However, I think the >>> most >>> >> persistence alternatives pharo has, the best. There is no better >>> >> solution for every escenario. So, I am also trying to get the >>> >> PostgreSQL native driver to work in Pharo. This package depends >>> on >>> >> Cryptography because of MD5. I know that there were added to >>> Pharo >>> >> packages like System-Hashing-core, System-Hashing-SHA1 and >>> System- >>> >> Hashing-MD5. However, the driver doesn't work yet. But adding >>> this >>> >> single method: >>> >> >>> >> ByteArray>>hex >>> >> | stream | >>> >> stream _ '' writeStream. >>> >> self do: [ :each | >>> >> stream >>> >> nextPut: ('0123456789ABCDEF' at: each // 16 + 1); >>> >> nextPut: ('0123456789ABCDEF' at: each \\ 16 + 1)]. >>> >> ^ stream contents >>> >> >>> >> The driver works like a charm in Pharo without needing >>> Cryptography >>> >> package. As far as I remember there were no MIT problem with this >>> >> package. Because of this those packages ( System-Hashing-core, >>> >> System-Hashing-SHA1 and System-Hashing-MD5) were integrated in >>> Pharo. >>> >> >>> >> So, can I add it? >>> >> >>> >> Thanks >>> >> >>> >> Mariano >>> >> _______________________________________________ >>> >> Pharo-project mailing list >>> >> [hidden email] >>> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>> > >>> > >>> > _______________________________________________ >>> > Pharo-project mailing list >>> > [hidden email] >>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- >>> project >>> > >>> >>> >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>> >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
On Sun, Aug 16, 2009 at 6:06 AM, Stéphane Ducasse <[hidden email]> wrote: sure! My change is ByteArray which is in the package Collections-Arrayed. I thought I have to commit my changes to PharoInbox but in that repo it is not commited this package. So, what should I do: 1) commit the hole package to PharoInbox repo 2) commit the change to Pharo repo
It is alerady opened here: http://code.google.com/p/pharo/issues/detail?id=1067 But I don't know how to tag it as 1.0 thanks Mariano
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
> 1) commit the hole package to PharoInbox repo
> > But I don't know how to tag it as 1.0 if you start to add a tag you should get a list. This is a google shitty interface (tm) _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
On Sun, Aug 16, 2009 at 6:53 PM, Stéphane Ducasse <[hidden email]> wrote:
Ahh okok. Now I found it. The thing now is...where I commit these change? (see my last email) Thanks Mariano
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Stéphane Ducasse
>> 1) commit the hole package to PharoInbox repo or read the wiki since everything is explained. How to contribute http://code.google.com/p/pharo/wiki/HowToContribute _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Henrik Sperre Johansen
Something I noticed when looking at ByteArray>>hex, anyone know the
reason why there's GC going on in do: with closure images, but not using the old bytecodes? Even with no closed-over variables in the block, it seems it creates extra fodder for the Garbage collector... Is it something the stack VM / Improved Garbage Collector will change? Cheers, Henry Simple test: intArray := (1 to: 10000000) asArray. TimeProfileBrowser onBlock: [intArray do: [:ix | ix yourself]] (It's not due to sampling overhead, Time millisecondsToRun: return similiar runtimes) Without closures (I used 250): -941 tallies, 965 msec. **GCs** incr 4 totalling 0ms With closures (I used 414): -1938 tallies, 1938 msec. **GCs** inc 2510 totalling 614ms _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Stéphane Ducasse
Stef: you can integrate it when you want:
Name: Collections-Arrayed-MarianoMartinezPeck.19 Author: MarianoMartinezPeck Time: 17 August 2009, 4:45:44 pm UUID: 0622a079-d239-4a4c-a78a-3f72fabea85b Ancestors: Collections-Arrayed-stephane_ducasse.18 Fix to bug: http://code.google.com/p/pharo/issues/detail?id=1067 I implemented ByteArray>>hex Cheers, Mariano On Mon, Aug 17, 2009 at 3:32 AM, Stéphane Ducasse <[hidden email]> wrote:
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
I will :)
Stef On Aug 17, 2009, at 9:53 PM, Mariano Martinez Peck wrote: > Stef: you can integrate it when you want: > > Name: Collections-Arrayed-MarianoMartinezPeck.19 > Author: MarianoMartinezPeck > Time: 17 August 2009, 4:45:44 pm > UUID: 0622a079-d239-4a4c-a78a-3f72fabea85b > Ancestors: Collections-Arrayed-stephane_ducasse.18 > > Fix to bug: http://code.google.com/p/pharo/issues/detail?id=1067 > I implemented ByteArray>>hex > > > > Cheers, > > Mariano > > > > On Mon, Aug 17, 2009 at 3:32 AM, Stéphane Ducasse <[hidden email] > > wrote: > > >> 1) commit the hole package to PharoInbox repo > > or read the wiki since everything is explained. > How to contribute > http://code.google.com/p/pharo/wiki/HowToContribute > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Free forum by Nabble | Edit this page |