Hi, I've just created a new team for MongoTalk on SmalltalkHub: http://www.smalltalkhub.com/#!/~MongoTalkTeam The old repo (http://www.smalltalkhub.com/#!/~francois/MongoTalk) will stay just in case some scripts rely on it but you should update to the new repo: http://www.smalltalkhub.com/#!/~MongoTalkTeam/mongotalk I've created a version 1.5.1 in the Metacello configuration to reflect the repo migration. Shout at me if I missed something! Cheers, Fa (Many thanks to Norbert for pushing the migration ;) |
nice!
Nico On Jul 8, 2013, at 2:45 PM, François Stephany <[hidden email]> wrote:
-- Nicolas Petton http://www.nicolas-petton.fr |
In reply to this post by fstephany
Hi!
I made some (imho) improvements to the OID implementation, if someone with write access would find time to review/commit the attached package, I'd be grateful. The commit message: Make OID implementation more compatible with the description in http://docs.mongodb.org/manual/reference/object-id/. - Use the UNIX epoch instead of Smalltalk epoch for timestamp part, store BE so it's pseudo-sortable by time (also, you can use getTimestamp() in mongo shell and get a sensible value) - Use a per-session ID instead of localhost name for machine identification. localhost name is far from unique on some platforms (always 'localhost' on Macs), better with a unique ID per image session. - Counter initialized with a random value. As an added bonus, [OID new] bench should see a ~10% increase in performance. Cheers, Henry
Mongo-BSON-HenrikSperreJohansen.43.mcz (24K) Download Attachment |
Henry,
Good idea. Even better. :) What do you think? I can make you a commiter on the MongoTalk repo. What's your username? Norbert
|
Hmm, yes, it seems localHostName could be implemented better in a way that works on all platforms. Instead of using the dedicated primitives (primHostNameSize/primHostNameResult:), it tries to lookup the localHostAddress using DNS... On OSX, primLocalAddress was changed to always return the loopback address so one avoids ambiguities with multiple interfaces, thus, 'localhost'. I've commit a fixed version to the Pharo 4.0 inbox. I still don't really see the value in using it over a random number that changes when the image goes through a restart cycle, as you can't really do anything useful with it anyways, and the docs do not enforce any specific way of obtaining it.
Just to be clear; when I said session, I meant image session, not db-connection session. My thinking was that, when you can't actually use it to distingush clients anyways, a somewhat-guaranteed-to-be-unique machine id per image would be a better choice than guaranteed-to-be-identical for all users on Macs.
henriksp is my user name. I tinkered some more, at the cost of readability, additional optimizations (by removing temporary object creations), can result in an order of magnitude more executions during a simple #bench test. Whether one actually needs to create 200k UIDs/second instead of 20k is another question, but in my experience, DB-interfaces can never be *too* low overhead... Cheers, Henry |
Thanks. But I think pharo 4.0 inbox is more or less closed and you should put it in pharo 5.0 inbox. Yes, you are right. I don't have strong reasons to keep it the old way. It was just my way of asking "if it is not important why did you change it then?"
Ok, I've added you to MongoTalkTeam. Just upload the version you find feasible yourself. Norbert
|
Pay attention to open a bug entry so that we can track the enh and
potentially harvest it for 40 and 50. Le 20/5/15 18:27, Norbert Hartl a écrit : > Hmm, yes, it seems localHostName could be implemented better in a way > that works on all platforms. > Instead of using the dedicated primitives > (primHostNameSize/primHostNameResult:), it tries to lookup the > localHostAddress using DNS... > On OSX, primLocalAddress was changed to always return the loopback > address so one avoids ambiguities with multiple interfaces, thus, > 'localhost'. > I've commit a fixed version to the Pharo 4.0 inbox. |
Free forum by Nabble | Edit this page |