-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Request] Integrate the EXPath Binary Module #54
Comments
Yes, but I got stuck implementing XPath 3.1
you could improve it a little:
|
That's a clever way to repeat a function 100000 times!
You're right. It's ±10% faster. But let's be honest, you won't notice any difference when you run the function just once. Thanks so far. |
I had not intended to post this here
That is weird. On my laptop real and user are the same at 4.5s
It is actually very slow, especially when you compare this int<->string conversion with native code. Xor in assembly is like thousand times faster |
Well, I'm glad you did. ;)
Probably a Cygwin issue. I don't know.
Obviously, but at least I have a solution for now. |
http://www.benibela.de/documentation/internettools/xpath-functions.html#x-integer:
I was just thinking (and maybe I should open a new "issue" for this)... Instead of... And the following expected results:
It would make What do you think? |
For the prefix you can just write |
Sure, ok. Any thoughts on the length/padding parameter? |
not sure about that. When there are too many parameters it becomes
confusing. (Although even the freepascal inttohex function has a padding)
format-integer is to do more complex formatting. But it does not support
different bases. The best thing would be to ask the w3c to allow
different bases in format-integer. But I doubt they will change anything
in the next years
|
I timed 100.000 runs with Forget about the length/padding parameter. The initial question was about the EXPath Binary Module anyway. |
I have implemented four functions of the module: http://hg.code.sf.net/p/videlibri/code/rev/dc34769d65d1#l2.149 The other functions can be implemented in the same way straightforwardly It is the perfect exercise for someone to learn Pascal and how to add functions to Xidel. |
Alright. Cool.
Obviously I'm not using it correctly. :D |
You need to convert the codepoints to a string first, and back later If someone implements bin:from-octets and bin:to-octets they could be used, and you won't need any strings |
Hah! How cumbersome. But, granted, it's still 8.5 times faster than my own |
I must be going mad. No matter what I do...
(didn't know about the last one, but got that from 'components/pascal/data/xquery_module_binary.pas') ...I constantly get |
The module is commented out, since it is incomplete https://github.com/benibela/xidel/blob/master/xidelbase.pas#L37 https://github.com/benibela/xidel/blob/master/xidelbase.pas#L3549 |
Ah, sorry. For the binary I compiled back then I must've uncommented those lines, but totally forgot about them now. |
Hello Benito,
For a specific task I need a "bitwise exclusive or"-function, but I realized
xidel
doesn't have one. So I created a function for that.I was wondering if, in addition to the EXPath File Module, you'd be interested in integrating the EXPath Binary Module as well. Then I can use
bin:xor()
instead (although for integers that would bebin:xor(string-to-base64Binary(<int>),string-to-base64Binary(<int>))
I guess... hmm).In the meantime can I have your professional opinion on the function I created? The following also includes notes leading up to that function.
What do you think? Would you have done it differently?
The text was updated successfully, but these errors were encountered: