Re: ANN: faster zipper implementation

2013-06-30 Thread Alexander Hudek
Thanks Zach! I've pulled your changes to 0.3.0-SNAPSHOT. Updated benchmark:

Case:  :clojure.zip
Evaluation count : 75480 in 60 samples of 1258 calls.
 Execution time mean : 805.666773 µs
Execution time std-deviation : 4.815877 µs
   Execution time lower quantile : 797.942766 µs ( 2.5%)
   Execution time upper quantile : 816.578299 µs (97.5%)

Found 2 outliers in 60 samples (3. %)
low-severe 2 (3. %)
 Variance from outliers : 1.6389 % Variance is slightly inflated by outliers

Case:  :fast-zip
Evaluation count : 297900 in 60 samples of 4965 calls.
 Execution time mean : 202.892179 µs
Execution time std-deviation : 848.456881 ns
   Execution time lower quantile : 201.212286 µs ( 2.5%)
   Execution time upper quantile : 204.187311 µs (97.5%)

Found 1 outliers in 60 samples (1.6667 %)
low-severe 1 (1.6667 %)
 Variance from outliers : 1.6389 % Variance is slightly inflated by outliers

I did try adding some inline forms, but they didn't seem to help. See this 
branch:

https://github.com/akhudek/fast-zip/tree/no-protocol+inline



On Sunday, June 30, 2013 7:46:53 PM UTC-4, Zach Tellman wrote:
>
> This is really cool, thanks for doing this.  I was able to eke out another 
> 1.8x speedup by replacing '=' with 'identical?' for the keyword comparisons 
> [1]. There also might be further room for improvement by defining inline 
> forms for some of the smaller functions.
>
> Zach
>
> [1] 
> https://github.com/ztellman/fast-zip/commit/ee7a64630389f36a539771658586a093369f7939
>
> On Sunday, June 30, 2013 1:18:05 PM UTC-7, Alexander Hudek wrote:
>>
>> I've updated the clojure.zip implementation to use records internally. 
>> This
>> achieves a speedup of roughly 2x. You can find the library below and on
>> clojars:
>>
>> https://github.com/akhudek/fast-zip
>>
>> It's a drop in replacement for clojure.zip in terms of interface and 
>> usage. 
>> However, since the internal representation has changed, fast-zip 
>> locations 
>> cannot be used with the clojure.zip implementation. E.g. you cannot
>> create a zipper with fast-zip, then use clojure.zip/next on the result. 
>> You 
>> must use fast.zip.core/next instead. 
>>
>> In addition to the micro-benchmark provided, I've tried this in a larger 
>> project
>> that makes extensive use of zippers and found a similar speedup.
>>
>> Comments and suggestions welcome.
>>
>> Alex
>>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANN: faster zipper implementation

2013-06-30 Thread Zach Tellman
This is really cool, thanks for doing this.  I was able to eke out another 
1.8x speedup by replacing '=' with 'identical?' for the keyword comparisons 
[1]. There also might be further room for improvement by defining inline 
forms for some of the smaller functions.

Zach

[1] 
https://github.com/ztellman/fast-zip/commit/ee7a64630389f36a539771658586a093369f7939

On Sunday, June 30, 2013 1:18:05 PM UTC-7, Alexander Hudek wrote:
>
> I've updated the clojure.zip implementation to use records internally. This
> achieves a speedup of roughly 2x. You can find the library below and on
> clojars:
>
> https://github.com/akhudek/fast-zip
>
> It's a drop in replacement for clojure.zip in terms of interface and 
> usage. 
> However, since the internal representation has changed, fast-zip locations 
> cannot be used with the clojure.zip implementation. E.g. you cannot
> create a zipper with fast-zip, then use clojure.zip/next on the result. 
> You 
> must use fast.zip.core/next instead. 
>
> In addition to the micro-benchmark provided, I've tried this in a larger 
> project
> that makes extensive use of zippers and found a similar speedup.
>
> Comments and suggestions welcome.
>
> Alex
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANN: faster zipper implementation

2013-06-30 Thread Zach Tellman
This is really cool, thanks for taking the time to do this.  I was able to 
eke out another 1.8x speedup by changing the keyword equality checks with 
'identical?' [1], and there might be some further room for improvement by 
defining inline forms for some of the smaller functions.

Zach

[1] 
https://github.com/ztellman/fast-zip/commit/ee7a64630389f36a539771658586a093369f7939

On Sunday, June 30, 2013 1:18:05 PM UTC-7, Alexander Hudek wrote:
>
> I've updated the clojure.zip implementation to use records internally. This
> achieves a speedup of roughly 2x. You can find the library below and on
> clojars:
>
> https://github.com/akhudek/fast-zip
>
> It's a drop in replacement for clojure.zip in terms of interface and 
> usage. 
> However, since the internal representation has changed, fast-zip locations 
> cannot be used with the clojure.zip implementation. E.g. you cannot
> create a zipper with fast-zip, then use clojure.zip/next on the result. 
> You 
> must use fast.zip.core/next instead. 
>
> In addition to the micro-benchmark provided, I've tried this in a larger 
> project
> that makes extensive use of zippers and found a similar speedup.
>
> Comments and suggestions welcome.
>
> Alex
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.