Giter Club home page Giter Club logo

Comments (7)

matklad avatar matklad commented on August 28, 2024 1

A very wise observation from: rust-lang/rfcs#1317 (comment)

In a strictly on-demand setting (IDE, not a compiler), serialization to disk creates more problems than it solves.

from salsa.

lnicola avatar lnicola commented on August 28, 2024 1

In a strictly on-demand setting (IDE, not a compiler), serialization to disk creates more problems than it solves.

Note that some popular IDEs like Visual Studio actually use a disk database. VS migrated a while ago from a custom format to a SQLite database: https://devblogs.microsoft.com/cppblog/introducing-c-experimental-editor-tools/.

from salsa.

lpil avatar lpil commented on August 28, 2024 1

Hi! This would be a desirable feature for me. Is this being worked on?

Not trying to rush you, just trying to evaluate how suitable this library is for my use-case. Thank you. :)

from salsa.

matklad avatar matklad commented on August 28, 2024 1

from salsa.

zseri avatar zseri commented on August 28, 2024 1

I think serialization should be generally opt-in:

  • maybe at salsa::database level:
    rather coarse, without lazy loading or transparent spilling, useful for "whole session" store/load and short-term-running scenarios
  • or even per query:
    fine-grained, with lazy loading and maybe transparent spilling, useful to reduce RAM usage in long-term-running scenarios

I think I already have a kind of usage scenario ("scenario" as in "salsa is currently not used, but I investigate potential usages") in zs-filecrawler.

Click to expand That program first walks through a file list and computes the hash of each file. Then it iterates over the list of hashes, takes the first associated file, and calls a user-defined hook script on that file. It caches the hash list and the progress. It might not really fit the usual `salsa` usage scenario, but the target is similiar: avoid redoing work.
QueryGroup 1: 
  file_content(filepath) <-- hash_data(filepath)
  ^-[maybe lazy input]      --> association [filepath -> hash_of_file_data]

QueryGroup 2:
  hash2file(hash)    <-- call_hook(hash)
  ^-[input, from QG1]   --> implicit association [hash -> done(hook return value)]

Currently, I just take the "session serialization approach", deserialize at startup, and serialize at shutdown/interrupt, but this may lose some progress. I think that the zs-filecrawler utility program could benefit from salsa, but it requires some way to serialize the state (the split into two QueryGroups would simulate that, but it makes interleaving both parts more difficult, and reduces potential benefits).

from salsa.

matklad avatar matklad commented on August 28, 2024

A similar, but different feature is to allow to transparently spill rarely used values to disk.

IntelliJ relies on similar feature heavily: when you open a multi-million line project with lots of dependencies, indices become really huge.

Note that this is a significantly different setup from rustc, which operates on a crate at a time, and has a reasonable natural cap on the amount of data it must process simultaneously.

from salsa.

lpil avatar lpil commented on August 28, 2024

Thank you

from salsa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.