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

Give SetHash a set/unset method #2942

Closed
wants to merge 1 commit into from
Closed

Give SetHash a set/unset method #2942

wants to merge 1 commit into from

Conversation

lizmat
Copy link
Contributor

@lizmat lizmat commented Jun 1, 2019

Inspired by seeing things like:

%sethash{$_} = True for @to-be-added;

in the wild. Instead, one can now do:

%sethash.set(@to-be-added);
%sethash.unset(@to-be-removed);

which is about 4x as fast.

Inspired by seeing things like:

    %sethash{$_} = True for @to-be-added;

in the wild.  Instead, one can now do:

    %sethash.set(@to-be-added);
    %sethash.unset(@to-be-removed);

which is about 4x as fast.
@Altai-man
Copy link
Member

Isn't it work for the optimizer?

@lizmat
Copy link
Contributor Author

lizmat commented Jan 29, 2020

Yes, Eventually. I think it will be quite some years before the optimizer is fast and smart enough to optimize this.

lizmat added a commit that referenced this pull request Feb 4, 2020
As proposed about 8 months ago in:
  #2942

Since nobody had a big objection against it, and I think it will
make working with SetHashes much easier, I decided to just put it in
(as the Pull Request had bitrotted).

Please revert if disagreeing.
@lizmat
Copy link
Contributor Author

lizmat commented Feb 4, 2020

Implemented with 6df78ca3ed

@lizmat lizmat closed this Feb 4, 2020
@Altai-man Altai-man deleted the SetHash-set-unset branch February 4, 2020 11:11
@Altai-man Altai-man restored the SetHash-set-unset branch February 4, 2020 11:11
@lizmat lizmat deleted the SetHash-set-unset branch February 4, 2020 11:13
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.

None yet

2 participants