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

Adding buffer & channel for Marshall & UnMarshall, fixing performance… #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lchanouha
Copy link

… issues & memory usage which large files

Hello,
I use your library to import / export LDIF with > 150K entries.

This commit addresses:

  • performance issues by replacing basic string concatenation with buffer concat
  • io management
  • added intermediate function to get entries with a channel, without building a huge ldif.LDIF table.
  • error handling, read error is added in the entry, and now skippable

I didn't change the behavior of Marshall and Unmarshall (same spec and error handling), to read / write
a lot of entries, theses functions are prefered:

  • func MarshalBuffer(l *LDIF, output io.Writer) (err error) -> to write to an buffer (memory, file, stdout..)
  • func UnmarshalBuffer(r io.Reader, l *LDIF) (error, chan *Entry) -> to output entries in a channel.

This is one on my first go code, maybe this commit should me checked (go test passed).

Regards,

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.

1 participant