XDC 2020 Keynote Discussion

It certainly could be
Copy from Xojo to the network interface (even if its a loopback)
Then when it reaches the “other end” do the reverse
Its not “free”

Shared memory is as close to free as you get - Peter Stys uses this in his app and its blazing fast because there is no copying
You put the data into the app and then it can be read by others directly
Its not trivial to set up but MBS does have a plugin that makes shared memory relatively easy to work with
You still cant move “objects” across it but you can move a LOT of data

and even the you cant transfer OBJECTS - not the references at least
you can move the data they hold across (using whatever formats you want) and recreate the objects on either side to keep them in sync

and for a LOT of stuff that will be adequate

Workers will be interesting to try out and see JUST how they work and what the limits are

Its probably the ONLY thing in the entire keynote I am looking forward to

You may remember I was working on a mechanism for serializing binary data from a DB cursor (though also an object or array of objects ) in a memoryBlock… and the address space of the memoryblock could be in shared memory… with a header describing the data… think of it as binary recordset in memory.

Anyway that was what i was planning to try to do long term.

  • karen

And you probably won’t get it in R1. Rotten luck.

That was my concern also. Processing a 100 megapixel 128-Bit image, will suck with IPC. Thankfully I’m pretty certain if these are just console apps, we should be able to use shared memory, maybe even IOSurfaces (GPU based).

There two bottlenecks that I see.

  1. He’s doing disk IO, which is not asynchronous (AFAIK).
  2. Scheduling; if each “job” completes quickly and the console app dies, there’s wasting time in setting up another one to do the next “job”. Even if the console apps are persistent, there’s still wasted time in simply managing the jobs. I suspect if each “job” (wasn’t disk based) did two or three tasks in a loop, there’d be less scheduling and improved performance.

It took me a while to get GCD to show a 7 fold improvement on a 4 core machine, simply because my initial tests were spending too much time scheduling, once I started to give each task more to do between scheduling, I started to see more improvement.

That’s pretty clever, did you get it finished, did it work?

Which declares are you using for the macOS, there’s two that I know of and one is not usable with a Sandboxed application (and maybe not with a Hardened application).

There’s another possibility I’ve been considering, which is a memory backed DMG. You’d have the overhead of using file IO API, but it should be quick, and relatively painless. For Sandboxed apps, you should be able to share a document based Security-Scoped Bodgemark. I noticed there’s even an option to make the DMG invisible to the Finder, so the user wouldn’t see it.

1 Like


My original idea was to use the binary serialization to send data to clients for in house client server apps using a modified Aloe Express server, to minimize memory use and processing on the server, and send it to the client in a form that it could be put into a memoryblock in a form that could be read without the overhead of JSON serialization and deserialization…

The memoryblock could optionally be Gzipped or the memoryblock could be built with blocks of Gzipped records for applications were RAM was tight on either the client or server…

I got that done for RecordSets or through code (adding fields and records through custom code)… Longer term was to use introspection to do it for the public properties for arbitrary class instances or arrays of instances … I did some work on that but had not finished it.

Then I started thinking about server processing using helpers and realized that would be the perfect mechanism for transferring data between server and helpers using shared memory to minimize memory use and processing…

So i did some research on how that could possibly be done without plugins… While i have the Einhugur plugins as there were a number of things I needed and renewals are not too expensive, I could not justify cost of MBS.

Also if it came out really well I might, want to release my classes and for that i woudl not want plugin dependancies…

But with Workers on the horizon, that project probably does not make sense anymore.

I was not worried about Sandboxed or hardened Apps as fo in-house stuff at work, that does not matter. As for which MacOS API’s found, I would have to look at the search results I saved back then.

I am not an OS declare guru for any platform, that part would have been the hardest for me.

Before today, this is one of the things I WAS considering working on if i was going to be home for the virus for a month or so.

1 Like

I’m currently doing that to / from a XojoScirpt context so xojo script can manipulate databases using much the same syntax as you would in a normal db (including database, recordset, etc etc etc)

From what Kem said that might be true

I’m 99% thinking this means that 3rd party controls written in Xojo can render in the IDE like native Xojo controls do (and plugins currently can).

For example, a canvas-based button could draw itself in the IDE based on the values you’ve set in the inspector.

That would be so great. I’m currently writing a module with a bunch of classes (canvas subclasses) and it would be super helpful to render them with a preview.

Btw, welcome @pidog

I doubt its the same way native controls do - you’ll be drawing the control using graphics primitives.
Native controls the IDE actually creates an instance and has the OS draw it
Thats not this

The thing thats added here is a special context object in the IDE that has an API that exposes a graphics object you can draw into
I’ve done that for my own projects but there is no way to make that work without the IDE’s assistance
The IDE has to have such a context object

Right, I should have emphasized like. It allows a control to render a reasonable facsimile of itself. A control that can render itself completely via xojoscript might be close to an exact rendering though.

I’m personally pretty excited to try it out.

it should make the in IDE experience better

I’m curious how it will affect IDE performance
Its one reason I’m not using 3.1 - its soooooo slllooooowwwwwwww despite the claims to have sped things up
I find it noticeably slower

Agree… I wouldn’t expect it to be much of a hit unless they recompile the script every time it renders though. It doesn’t seem like the ide does any significant cacheing currently, so there’s a lot of rendering going on.

actually the IDE does do a lot of caching of what it can cache so it doesnt ask the os to readraw controls all the time
or let me say it used to but that seems to have slowed a LOT

but there are some controls where even small changes require a redraw
like changing the initial value of a listbox
you can really only ever change that before its set up and changes after its created & drawn have no effect (this is true in our own code as well)
so to get it redrawn you have to create a whole new instance and redraw it

there are several controls that are like that where you have to recreate them to get them to redraw with whatever new properties

but, when possible, the IDE used to cache a pile
the background layer, the window frame and all the control images it could

really this part isnt rocket science
its quite literally what “draw into” is for
there’s only a handful of controls that dont use that to draw themselves for the IDE

1 Like

Me too. additionally it’s extra eye candy for third party vendors selling custom controls.

I welcome it; t’was only a few weeks ago I wrote a application to do just this so that I could save time when designing (and testing) custom controls or even interfaces.

The main reason I refrained from bragging about it, is because I only added support for what I needed at the time and secondly, without being able to use the Xojo code editor in it, it can make it much harder to use. i.e. no auto complete, syntax highlighting and so on.

1 Like

ah … I thought this seemed familiar

Am I the only one who thinks that new controls with new events is like renaming events just worse? Now we have to replace all our controls - hundreds and hundreds of them - instead of just renaming the events. And the benefit is zero.