@starseeker I know it's not hooked up, but help is the furthest along of libged's new command structure. Please don't merge the deletion.
(talking about libged/help)
@Sean No problem - I only merged the relocations because I figured they were harmless and would make life easier down the road - the bit I'm into now is a bit crazier.
What I'm trying is a bit different from what was there (at least, so far) so I don't know if it will be acceptable in the end or not - it's mostly an experiment, and may end up being a throw-away.
the relocations aren't a problem, that's been the plan, so it's all good. it's the commit on the branch deleting help/help.cpp that was a lil concerning.
@Sean That was a temporary measure for compiling while setting up the change in the API - I should have commented it out rather than deleting it.
@Sean fixed - gedplugins branch now has the help and zoom plugins enabled using the new setup.
cool
I like them dynamically loading. will be interesting to see how that scales up, what if anything it does to initialization.
also sets the stage for having a single runner process that dynamically loads and communicates back over a channel -- complete protected process encapsulation
/me is being driven slightly batty by the libged file names and function names not necessarily matching the invocation strings higher level code expects, but starting to get some interesting progress now.
Must confess I started down this road trying to see if I could come with a way to avoid all the verbose wrapping logic in the libtclcad layer... figured at the very least it would force me to understand which pieces are doing what.
/me sometimes prefers to trample down the maze rather than wind his way through it...
My initialization here (and shutdown) seems to be dominated by Tcl/Tk.
careful reading into those tea leaves there. it's super i/o heavy, so throwing in a ton of additional syscalls could be exasperating it in ways that won't measure correctly easily.
Fair enough - just going by wall clock time. I've notice the same thing with other Tcl/Tk apps on this system (gitk, for example).
There is a strange stall that seems to happen only sometimes (perhaps tcl index rebuilding, dunno, guessing) that can stall MGED on first launch after install, lasting 20-100 seconds... I haven't been able to reproduce it reliably, but I have seen it.
/me nods - seen that too, same symptoms.
I think the libged refactor is starting to get interesting. As far as I can tell, I've got MGED and libtclcad working with the new setup.
I saw, looking good.
only thought that's come to mind is "I wonder how slow that is" ;)
I'll have to try a Windows build next, and maybe toss it on the Github mac runner
Um. Do we have benchmarks for that? It shouldn't bother the standard raytracing benchmarks much...
I had a little test runner I made for indianlarry that I wish I'd kept -- but could probably reproduce
it timed how fast commands could run, pushed their limit
I know it's not a fair question, but if there's any way to know what I need to aim for... How slow is "too slow" in this case?
if restructuring libged slows down the benchmarks, that enters revert territory because libged shouldn't even be involved :D
starseeker said:
I know it's not a fair question, but if there's any way to know what I need to aim for... How slow is "too slow" in this case?
I don't think any single command matters unless it gets into non-responsive territory. commands that should complete immediately that are taking 500 to 5000ms for example, when they maybe took 5ms before -- that would be a problem I think
Sounds like a candidate for a regression test, actually...
the general bar for interactivity is 20 per sec, which is 50ms
Would need to "normalize" somehow on the platform at the beginning of the run, but if we recorded an expected range based on a ratio of the control test maybe? Even fairly large error bars might be useful for spotting bad problems getting introduced...
if a command doesn't complete in under that, it's not "interactive". now in practice, I think most people's tolerance is more like web page tolerance, not necessarily interactive rate, but "responsive" enough and that sits in the 2s ballpark.
/me gets an idea...
where a slowdown would be concerning is any commands that call into other commands. like if search suddenly goes from 1s to 10s .. that implies an architecture problem getting introduced.
I doubt that's happened though
it'd be nice to have a dashboard of how long each command takes to do its intended function
which would imply having a test for every command, which we don't have yet though either
Well, my libged plugin test is iterating through calling all of them (or should be, at any rate)...
the mged test calls them all too, to make sure they all report help -- not the same as doing and timing their intended function though
Ah. That shouldn't be needed for overhead comparison though, should it? Or is there a chance that living as a shared object will slow down the execution?
it depends on where slowdown came from
saw we screwed up rt_db_export_internal performance for example, wouldn't show just by testing usage or help
they have their place as a test, just not as interesting for dashboarding purposes at least
and regarding performance for usability testing, startup time is just a fraction of the time that matters
@Sean I doubt it's the number you're after, but if it's of interest I added a timer in ged_exec...
heh, you know you just added another syscall right??
ah, apparently it depends -- might not be a syscall
looks like it is a system call, but doesn't always provoke typical system call behavior -- it depends on the OS and libc implementation. may at least avoid an allocation, but may still cause an interrupt/stall.
To the overall timing, yes - I thought the issue of main concern was whether the invocation of the ged commands was being slowed?
The idea was to show execution times to evaluate whether things look "too slow" or not, and then remove it once it passes muster...
yes, that was the immediate question. Doesn't need to persist as a feature, though -- just for awareness.
yeah, thumbs up
Ironically, the new approach is a whole lot easier to instrument than traditional ged calls - no single entry point there to watch.
sure, but that's because you made a ged_exec to call them .. and that's been the plan all along regardless of them being dynamic or not
/me nods. So the question is whether they should just all be built as one library in lieu of the individual .so files?
/me figured the latter was a good stepping stone to per-process commands (which I would expect to be slower than this approach, really...)
all or some subset, we may find there's a benefit in having a core guaranteed preloaded
yep
per-process will be even more overhead, that's why it's all just situational awareness curiosity. I don't expect it to be much more than a few ms increase.
if anything, it could conceivably reduce overall runtime while increasing individual commands, because not all have to be resolved by ld during startup
it should just be adding a few interrupts to do the .so search, open, scan+read the file to get the symbols. that's probably not very much and should only be on the first call.
So, bottom line, what's the path forward? I'm not in a tearing hurry to merge - my target is libtclcad and I can tangle with that in this branch well enough - but we'll need some plan to move forward eventually. This'll be a tough to maintain long term as a branch if any significant work starts on libged in trunk...
if mged seems to be behaving and there's not an obvious slowdown, no major concerns from me.
if it's slower, that should be born out by observation of an issue (e.g., search 10x slower or something). any fix should be with an eye towards fixing a specific observed problem. i don't think this change warrants hunting for a problem necessarily. a sanity check on a couple typical commands should be enough hopefully, and it'd be good to merge.
Sounds good. Time to boot the laptop into Windows again... ugh.
/me does the github Mac test first because it's more fun...
Last updated: Jan 09 2025 at 00:46 UTC