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

lib.join is slow and unnecessary #3

Open
dlaurie opened this issue Jul 5, 2018 · 5 comments
Open

lib.join is slow and unnecessary #3

dlaurie opened this issue Jul 5, 2018 · 5 comments

Comments

@dlaurie
Copy link
Collaborator

dlaurie commented Jul 5, 2018

The algorithm in lib.join is extremely slow, requiring allocation of a new string for every element in the array. Moreover, lib.join appears to do exactly the same as the standard function table.concat.

Suggestion: replace its definition by

lib.join = table.concat

@dlaurie dlaurie changed the title lub.join is slow and unnecessary lib.join is slow and unnecessary Jul 5, 2018
@dlaurie
Copy link
Collaborator Author

dlaurie commented Jul 13, 2018

Never mind. I can monkey-patch that later, after I require 'xml'.

lib.join does not always do exactly the same: it respects the __concat metamethod but table.concat does not.

@gaspard
Copy link
Member

gaspard commented Jul 14, 2018

Hi @dlaurie. I'm sorry that I don't work with Lua anymore and am not maintaining this. I can give you write access to the repo and arrange so that you can publish to luarocks if you want.

@dlaurie
Copy link
Collaborator Author

dlaurie commented Jul 14, 2018 via email

@lubyk
Copy link
Collaborator

lubyk commented Jul 14, 2018

OK. Done. Don't hesitate to ring me if you need access to other packages.

@gaspard
Copy link
Member

gaspard commented Jul 14, 2018

(I mean ring @gaspard).

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

No branches or pull requests

2 participants