Skip to content
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

Riak vcard #460

Merged
merged 25 commits into from
Oct 12, 2015
Merged

Riak vcard #460

merged 25 commits into from
Oct 12, 2015

Conversation

michalwski
Copy link
Contributor

Riak backend for mod_vcard.

This is done on top of #378

@mongoose-im
Copy link
Collaborator

travis is using test branch riak-vcard from https://github.com/esl/ejabberd_tests/tree/riak-vcard

@@ -28,3 +29,16 @@ string_to_binary(S) when is_list(S) ->
end;
string_to_binary(B) when is_binary(B) ->
B.


join([], _) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could be more optimal:

join(Parts, Sep) when is_integer(Sep) -> join(Parts, <<Sep>>);
join(Parts, Sep) -> join(Parts, Sep, <<>>).

join([], _Sep, Acc) -> Acc;
join([Part], _Sep, Acc) -> <<Acc/binary, Part/binary>>;
join([Part | RParts], Sep, Acc) -> join2(RParts, Sep, <<Acc/binary, Part/binary, Sep/binary>>).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually some time ago I saw some micro-benchmarking done by @arcusfelis showing that io_list_to_binary is faster than incrementally built binary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, true, I think I saw it too. I wonder if it still holds with current OTP versions (AFAIR those were done with R16).

ppikula added a commit that referenced this pull request Oct 12, 2015
@ppikula ppikula merged commit 825f250 into master Oct 12, 2015
@ppikula ppikula deleted the riak-vcard branch October 12, 2015 10:41
@michalwski michalwski mentioned this pull request Oct 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants