Timing diagram problems with very large values

0 votes
asked Mar 26 in bug by hagmonk (160 points)

I tried to recreate the "latency numbers every programmer should know" table, but using plantuml's timing diagram instead. You can find the original data here: https://gist.github.com/hellerbarde/2843375

I encountered a few problems. This is definitely pushing the limit of the timing diagram deliberately, I was not expecting it to magically handle this crazy diagram :) But I do think it's a good pathological test case, being able to handle this range of inputs would make it very flexible for producing a range of timing related visualizations. 

1) it's not possible to specify the state as a string with spaces, only as a single word. So I can't say "250 ns", I have to write instead 250ns.

2) I couldn't find a way to make the state not continue indefinitely. For example, I want the 5ns bar to stop at 5. As a workaround, I had to set the state to the empty string "", and this at least made things work, but now every participant has an empty blue bar for the entire graph.

3) fractional values aren't accepted, so the first 0.5ns for L1 cache isn't able to be listed at all.

4) the image isn't scaled to fit based on the sizes of the values specified. As a result, trying to render the full image with the 150,000,000 ns timing will exhaust someting and crash plantuml.

5) logarithmic scales would be nice too, even though in this case I wanted a normal scale to emphasize the size differences in the latencies.

6) the end result even when eliminating the scaling problems isn't that great - but this was just my first attempt to use this diagram type and I'm surely missing some tricks.

@startuml
concise "L1 cache reference" as L1
concise "Branch mispredict" as BM
concise "L2 cache reference" as L2
concise "Mutex lock/unlock" as MUX
concise "Main memory reference" as MEMREF
concise "Compress 1K bytes with Zippy" as ZIP1K
concise "Send 2K bytes over 1 Gbps network" as SEND2K
concise "SSD random read" as SEEKSSD
concise "Read 1 MB sequentially from memory" as RAM
concise "Round trip within same datacenter" as DC
concise "Read 1 MB sequentially from SSD" as SSD
concise "Disk seek" as SEEKDISK
concise "Read 1 MB sequentially from disk" as DISK
concise "Send packet CA->Netherlands->CA" as NET
 
@0
L1 is done
BM is 5ns
L2 is 7ns
MUX is 25ns
MEMREF is 100ns
ZIP1K is 3000ns
SEND2K is 20000ns
SEEKSSD is 150000ns
RAM is 250000ns
DC is 500000ns
SSD is 1000000ns
SEEKDISK is 10000000ns
DISK is 20000000ns
NET is 150000000ns
 
@5
BM is ""
 
@7
L2 is ""
 
@25
MUX is ""
 
@100
MEMREF is ""
 
@3000
ZIP1K is ""
 
@20000
SEND2K is ""
 
@150000
SEEKSSD is ""
 
@250000
RAM is ""
 
@500000
DC is ""
 
@1000000
SSD is ""
 
@10000000
DISK is ""
 
@150000000
NET is ""
 
@enduml

1 Answer

0 votes
answered Mar 27 by plantuml (134,570 points)

Agree that it's a good pathological test case!

We've fixed 1) and 2)

About 3), we really want to stick to integer number. So we won't fix it. You can round 0.5ns to 1ns :-)

About 4-5-6 we are still thinking about it.
Note sure that logarithmic would make sense in timing diagram.
Maybe we could automatically add a "break" in the timeline like in http://digitaltimingdiagrams.com/static/images/Basics1.jpg ?
Any idea welcome!

Right now, the following example is working with last beta
https://www.dropbox.com/s/koo42q3d9gxw288/plantuml.jar?dl=0

@startuml
concise "L1 cache reference" as L1
concise "Branch mispredict" as BM
concise "L2 cache reference" as L2
concise "Mutex lock/unlock" as MUX
concise "Main memory reference" as MEMREF
concise "Compress 1K bytes with Zippy" as ZIP1K
concise "Send 2K bytes over 1 Gbps network" as SEND2K


@0
L1 is done
BM is "5 ns"
L2 is "7 ns"
MUX is "25 ns"
MEMREF is "100 ns"
ZIP1K is "3,000 ns"
SEND2K is "20,000 ns"


@5
BM is {hidden}


@7
L2 is {hidden}

@25
MUX is {hidden}

@100
MEMREF is {hidden}

@3000
ZIP1K is {hidden}

@20000
SEND2K is {hidden}

@enduml

 

commented Apr 14 by BrianChristensen (120 points)
I downloaded the bet and the above did not scale properly....possible fault(java?, graphvis?) ?
...