Open hughleat opened 3 years ago
Chris, I like your idea about just having it based on hashes :-)
Thanks for writing this up @hughleat!
One thing I would like to take a quick look at before diving in is to see what the overhead of calculating a hash is on every step. AFAIK the best way of generating a hash for LLVM-IR is writeModule()
, which might be quite expensive for larger programs.
Cheers, Chris
Possibly hashing could be avoided unless explicitly asked for:
BTW, could also possibly do things like:
Actually, upload could just be a command, too:
From the service perspective, the client calling get-hash
suggests that caching that thing for a while might be helpful. Not that it shouldn't cache other things, too, but at least make those things more likely to survive when something has to be evicted from the cache.
Possibly allow get-hash
to create a name that can then be reused.
Making the service stateless would make everyone happy! This feature req is more a place for thrashing out ideas.
Basic idea is that the service has a set of things, indexed by some hashes. The client asks for operations to be done to a thing. The service does them and returns the results.
Two commands:
A session might look like:
apply(h1, compile-to-bc, opt(-adce), ir-size, opt(-mem2reg), compile-to-bin, binary_size)
404
- I don't recognise your h1!upload(my-C-file)
apply(h2, compile-to-bc, opt(-adce), ir-size, opt(-mem2reg), compile-to-bin, binary_size)
h3, h4, 10KB, h5, h6, 8KB
. I.e. Hashes for each command, query results for each query.apply(h5, opt(-inline), compile-to-bin, binary_size)
h7, h8, 9KB
. I.e. starting from an existing point, do something a little different.The service would be responsible for caching command and query results to make things fast.
Not sure about time to live - especially for uploads.