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

Poc of generating _data.rs from ../_data folder #47

Closed
wants to merge 2 commits into from

Conversation

ZibanPirate
Copy link
Member

@ZibanPirate ZibanPirate commented Jan 4, 2024

see #46

@github-actions github-actions bot added the rust label Jan 4, 2024
@ZibanPirate ZibanPirate mentioned this pull request Jan 4, 2024
5 tasks
@omdxp
Copy link
Member

omdxp commented Jan 5, 2024

I'm still hesitated about this approach, even though you're creating stack variables you still have some String fields that points to the heap (and that's a lot). Not to mention only that you are creating many variables on the stack.

I'd rather fetch the needed data from the disk instead of having everything in memory.

A more suitable approach is to have something like Redis, we can have in memory data for specific period of time (I'm thinking about backenders here 😅)

@ZibanPirate
Copy link
Member Author

ZibanPirate commented Jan 5, 2024

I'm still hesitated about this approach, even though you're creating stack variables you still have some String fields that points to the heap (and that's a lot). Not to mention only that you are creating many variables on the stack.

true, although, it will be significantly faster, the toll on the memory will be significant.

I'd rather fetch the needed data from the disk instead of having everything in memory.

I can see that as a valid use-case, when memory is limited, and speed is not the most important, and the storage system is fast enough.

A more suitable approach is to have something like Redis, we can have in memory data for specific period of time (I'm thinking about backenders here 😅)

I can't see the difference between this and the first solution, other than consuming a lot more memory 😄

so, there seem to be different approaches, with different caveats.

How about having multiple solutions then :), and hiding each behind a feature? eg: features = ["from-storage", "from-lazy-static", "no-data", "from-stack" ] ? (The pure "from-stack" will be very interesting to work on, as we won't even need serde)

@omdxp
Copy link
Member

omdxp commented Jan 5, 2024

How about having multiple solutions then :), and hiding each behind a feature? eg: features = ["from-storage", "from-lazy-static", "no-data", "from-stack" ] ? (The pure "from-stack" will be very interesting to work on, as we won't even need serde)

Dude, now we're talking! 🚀

Base automatically changed from 44-add-rust-support to main January 5, 2024 21:10
@omdxp omdxp closed this Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants