Published
Edited
Apr 26, 2021
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
buildResult = {
const t0 = performance.now();
// this line create the datastructure everything else is just timing code!
const completions = new SimpleFastPrefixCompletions({
words
});
const t1 = performance.now();

return { completions, buildTime: t1 - t0 };
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
serializeResult = {
const t0 = performance.now();
const serializedCompletions = buildResult.completions.toJSON();
const t1 = performance.now();
return { serializedCompletions, serializedTime: t1 - t0 };
}
Insert cell
Insert cell
deserializeResult = {
const t0 = performance.now();
const deserializedCompletions = SimpleFastPrefixCompletions.fromJSON(serializeResult.serializedCompletions)
const t1 = performance.now();
return { deserializedCompletions, deserializedTime: t1 - t0 };
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more