in reply to Re: patchable settings
in thread patchable settings
Update: also check for '+'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: patchable settings
by demerphq (Chancellor) on Sep 28, 2004 at 07:30 UTC | |
I don't understand why people are reluctant to use techniques like version codes here. (I say this because ive noticed others also dislike version codes.) To me a settings field is just a data format which is really a file format. And its usually better to code version strings into such systems early while its easy. The flexibility such a mechanism offers in a situation like here is quite nice if you ever have reason to change the way things work. And I've had call to use it elsewhere on PM to good effect already.
Since bullet proofing getVars() probably means it faster to do than the current method, I personally dont see why we shouldn't do it.
---
demerphq First they ignore you, then they laugh at you, then they fight you, then you win.
• Update: | [reply] [d/l] |
by ysth (Canon) on Sep 28, 2004 at 07:42 UTC | |
It's your call; if you say so, I'll take what you have above and integrate it with my unpackVars/packVars (though I'd much prefer just to use the escape() and unescape() that are already there). | [reply] |
by demerphq (Chancellor) on Sep 28, 2004 at 07:57 UTC | |
it means taking really short simple code and making it less so; Except that less code is actually executed and there is less stack overhead. second, it reduces the readability of the raw data. How does it do that? The current mechanism uses url encoding to handle \W chars. This mechanism would leave everything alone except for =,& and %. (Pick three less common chars if you want... I did in the personal nodelet stuff.) Im not saying you should definatively do anything, im just arguing that my suggestion is sound. Im hoping others pipe up with their thoughts too (although really only people that use setting's will have any experience to guide their thoughts). My position is that making my proposed changes would make a lot of things more robust and easy to deal with and actually be a marginaly net gain in efficiency due to less code and faster encoding. I dont see why we would give up those benefits for what we have now given the relative costs.
---
demerphq First they ignore you, then they laugh at you, then they fight you, then you win.
| [reply] [d/l] |
by ysth (Canon) on Sep 28, 2004 at 08:55 UTC | |
by ysth (Canon) on Oct 05, 2004 at 19:03 UTC | |
I think I've placed more emphasis (or at least tried to) on readability and reuse than what you had suggested. I'm guessing it will be about as fast as the existing code. If you are ok with this, I'll try it out on the test server. | [reply] [d/l] |
by demerphq (Chancellor) on Oct 06, 2004 at 09:20 UTC | |
I think I've placed more emphasis (or at least tried to) on readability and reuse than what you had suggested. Yeah style wise I agree. But there was a point to my use of that type of packing scheme. Its a lot faster and the resulting text is smaller than the current one and it renders the text less illegibile in raw form. Just avoiding the overhead of the escape call is worthy IMO. Also the scheme I used can be made a litte more dynamic and self documenting by a more verbose rewrite. I think its worth finding out the full requirements of this (ie possible charset restrictions) and getting a fast light implementation done once and for all. Settings are used a _lot_, shaving time on them is very worthwhile IMO. But i definately like this a lot more than the earlier ideas. One last thing, can I suggest that you use == at the start of the string? What you have there is a possible valid start of a vars. '=00&' could come from { ''=>'00','1'=>'1' } for instance. I suggest '==00&' so that its impossible to occur under the current codebase.
---
demerphq First they ignore you, then they laugh at you, then they fight you, then you win.
| [reply] |
by ysth (Canon) on Oct 06, 2004 at 18:11 UTC | |