Deno: Convert all Flatbuffer ops to JSON

Created on 22 Aug 2019  路  8Comments  路  Source: denoland/deno

To all contributors who are listening -

We want to convert all of the flatbuffer ops to JSON. Here is a commit showing how to do it. And another.

There's many ops to convert, and if you are interested, this is would be a helpful contribution.

I'm currently working on js/os.ts - please let me know if you want to work on some of the ops, I'll try to coordinate people so there's no double work happening. Base work off https://github.com/denoland/deno/pull/2799

Here is a list of ops we need to convert:

The only ops we are not converting are read, write, readSync, and writeSync.

Most helpful comment

I can work on metrics.rs

All 8 comments

I'll take these for a good start:

* compiler.rs
* errors.rs
* fetch.rs
* files.rs

I can work on metrics.rs

I should convert following files tomorrow:

* net.ts
* performance.rs
* permissions.rs
* process.rs
* random.rs
* repl.rs
* resources.rs
* timers.rs
* utils.rs
* workers.rs

Hello @ry, may I ask why do you want to convert everything to JSON? Did you find it faster than flatbuffers?

@s-panferov actually the opposite - we found flatbuffers too slow and we don鈥檛 yet know the speed of this JSON serialization.
We have some ops which are very hot: Deno.read and Deno.write. These we converted to a custom serialization and got some perf increases.

The other ops are not measured in our benchmarks - so we don鈥檛 particularly care how fast they are. More important is the ease of implementing and maintaining them. The flatbuffer API is unfortunately very verbose. It also complicated our build at a time when we鈥檙e trying to move from gn/ninja to cargo based. So the JSON serialization will help simplify things and not effect the benchmarks.

@ry I believe io.rs shouldn't be ported - it already uses minimal dispatch

I think I'm gonna go ahead and port remaining ops from fs.rs

This is complete now thanks to a massive effort from @bartlomieju !

a6f6209f5277f2737bc67efad5c91ab168aff6b5
520f9631e09aa720fd8c03513ee8ea967f5ed4b2
017f88ee99b0fe40221e6af92e0b6a976fbaf2ad
2235dd795d3cc6c24ff1bdd1bbdcd110b4b0bdfc
137f33733d365026903d40e7cde6e34ac6c36dcf
79f82cf10ed1dbf91346994250d7311a4d74377a
5b2baa5c990fbeae747e952c5dcd7a5369e950b1
bc467b265fbe06ace24f5d9536bd8eb36ae4a601

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ry picture ry  路  3Comments

doutchnugget picture doutchnugget  路  3Comments

watilde picture watilde  路  3Comments

davidbarratt picture davidbarratt  路  3Comments

zugende picture zugende  路  3Comments