Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use publish / subscribe architecture. #465

Closed
tbnorth opened this issue Apr 2, 2017 · 4 comments
Closed

Use publish / subscribe architecture. #465

tbnorth opened this issue Apr 2, 2017 · 4 comments
Assignees
Labels
Enhancement Won'tDo Issues that EKR won't do

Comments

@tbnorth
Copy link
Contributor

tbnorth commented Apr 2, 2017

This is really just a placeholder for some research.

For the Leo Editor Pane development I've tested a publish / subscribe architecture, or signal / connect architecture. It includes an experimental emission of a signal from v.setBodyString(). I tested the performance impact with this code:

nd = p.v.insertAsLastChild()
import time
start = time.time()
for i in range(100000):
    new = nd.insertAsLastChild()
    new.b = 'test'
g.es(time.time()-start)
p.deleteAllChildren()

Twenty trials with and without the signal emission, mean 1.3 sec without, 1.4 seconds with, 8% slowdown. But I think it's important to emphasize that this is 8% on a very fast (76,000 nodes per second) operation. So it's not 8% on the load time for a file, it's 8% on a very short subset of the load time for a file.

The tests had really high variance (ranges of 0.99-2.91 and 1.07-2.38 respectively), which seems strange. Observed on two different machines - something to do with dynamic CPU clockspeed adjustment maybe?

@tbnorth
Copy link
Contributor Author

tbnorth commented Apr 2, 2017

For comparison, I think LeoPyRef.leo has only 7800 nodes, so a minuscule impact typically.

@edreamleo
Copy link
Member

edreamleo commented Apr 3, 2017 via email

@edreamleo
Copy link
Member

While trying to find the quote, I ran across this stack overflow answer. I thought the fourth answer (starting with "I'll let you in on a secret: the best way to use timeit is on the command line.") was the most interesting/surprising.

@edreamleo
Copy link
Member

This will not happen unless Terry does it.

@edreamleo edreamleo added Won'tDo Issues that EKR won't do and removed BackBurner labels Jan 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Won'tDo Issues that EKR won't do
Projects
None yet
Development

No branches or pull requests

2 participants