adrian-pace / FROG-analytics

Metrics and visualizations on the behaviour of users in various online editors
1 stars 3 forks source link

paragraph.split take original position and not effective position #10 #4

Closed adrian-pace closed 6 years ago

adrian-pace commented 6 years ago

@pykcel A split is when you add a new line inside an existing written line (as if you split a paragraph in two). n is the number of ops. a(e) is the number of elem_ops located after elementary operation e at time of e. b(e) is the number of elem_ops located before elementary operation e at time of e. What do you think is fastest: for each elementary operation e ordered by time, do a(e) operations. At each split (relativeley rare ?), for each operation in the paragraph splitted (approx n/#para), do b(e) operations.

In other words: if s is the number of splits and L usual number of elem_ops in a paragraph what is the fastest : O(na) or O(sLb) ?

I guess b is arround 3 times bigger than a because usually you write at the end of the file.

But I'm betting that s (number of splits) is sufficiently small such that s*L*3 < n <=> s*n/#para*3<n <=> s*3<#para. Would you agree?

adrian-pace commented 6 years ago

Fixed using the first option