Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.

Use Vec to implement the Events iterators - #117

Merged
bodil merged 1 commit into
bodil:masterfrom
cuviper:events-iter-vec
Apr 24, 2020
Merged

bodil merged 1 commit into
bodil:masterfrom
cuviper:events-iter-vec

Conversation

@cuviper

@cuviper cuviper commented Apr 22, 2020

Copy link
Copy Markdown
Contributor

Using vec::IntoIter is much simpler than a deeply nested Chain,
compiling faster and avoiding the deeper recursion limit reported in
rust#71359.

Using `vec::IntoIter` is much simpler than a deeply nested `Chain`,
compiling faster and avoiding the deeper recursion limit reported in
[rust#71359](rust-lang/rust#71359).
@cuviper

cuviper commented Apr 22, 2020

Copy link
Copy Markdown
Contributor Author

cc @chrysn #115

I'm not familiar with actually using this crate, as I just looked into this for the Rust issue. I'd be interested to know how this affects performance -- I hope the added cost of Vec allocation is offset by the much greater simplicity of the iterators.

@chrysn

chrysn commented Apr 24, 2020

Copy link
Copy Markdown
Contributor

In the test I've crudely sketched up, this behaves equivalently to the #115 version (which solves the same issue but just ups the recursion depth). A rough comparison indicates equal or slightly-better performance of this over #115, by I have zero trust in the test setup as I don't really know what I'm benchmarking or what for.

I really can't say anything about the suitability of the Vec allocation, as I don't yet use the parts of typed-html that deal with exotic allocators (like dodrio on bumpalo) where it may or may not be relevant.

@bodil

bodil commented Apr 24, 2020

Copy link
Copy Markdown
Owner

The Vec shouldn't have an impact on Dodrio, it couldn't be allocated using a bump allocator in any case.

Anyway, good work, merging 👍

@bodil
bodil merged commit d95ce1a into bodil:master Apr 24, 2020
@bodil bodil mentioned this pull request Apr 24, 2020
@cuviper

cuviper commented May 22, 2020

Copy link
Copy Markdown
Contributor Author

@bodil could you publish a new release, so we might feel safer in closing that Rust issue? 🙂

@andybalaam

Copy link
Copy Markdown

Because there is no release yet, I depended directly on the latest git commit in my Cargo.toml like this:

typed-html = { git = "https://github.com/bodil/typed-html#4c13ecca" }

and my broken compile is fixed!

To feed the search engines, the compile error I had before was:

error: overflow representing the type `std::option::Option<&T>`

rofrol added a commit to rofrol/rustommerce that referenced this pull request Aug 24, 2020
iamcodemaker added a commit to iamcodemaker/euca that referenced this pull request Aug 31, 2020
This contains a fix for that now allows release builds to be made.

bodil/typed-html#117
@dullbananas

Copy link
Copy Markdown

@bodil you should release this fix to crates.io

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants