Silverlight Client Performance and Resource Usage - silverlight

I'm tempting to use Silverlight 3 tio create a LOB Application but I'm no quite comfortable into measuring client resource usage (CPU and RAM). Is there a way to measure exactly how much RAM /CPU a Silverlight App is using on the client ??? Are there any tools for this ?

use the System.Windows.Analytics class to get the AverageProcessLoad and AverageProcessorLoad

SilverlightSpy measures this, at at high level. I am trying to find similiar tools at the moment and it seems that only Windbg and SOS willget right into the guts of your application :-(

Related

What's the most efficient way for sending huge data from silverlight to the JavaScript environment of the browser?

I have a Microsoft Silverlight application recording sound, obtaining that as chunks of byte Arrays.
What is the most efficient and reliable way to get this byte array from the Silverlight sandbox to the JavaScript environment?
My considerations so far:
How much overhead is involved in calling a JavaScript method from within Silverlight?
Is there a recommended interval? Note that the data to be transferred would grow with the time as recording is still going on.
Is it possible to convert this Array directly into a UInt8Array?
Would using Websockets over localhost be a viable option? How to implement the Server in Silverlight?
Other ways?
Background is that getUserMedia is still under review by Microsoft and I'd like to avoid Flash and want to process the sound data using JS and not in Silverlight.
Edit: Now, Media Capture and Streams is being developed for IE (but still not available).

Silverlight Multi-User application with synchronization

I am wondering if it's possible to create a graphical application in Silverlight which supports synchronisation between the different clients.
To be a bit more precise, I am drawing concepts of developing a Silverlight Game. Visitors would log-in, and see live, synchronised what the other vistors are doing.
If it is possible to have this implemented, I would like to know what is needed to create a fully synched Silverlight environment between multiple peers. Anything from links, code snippets, ideas and / or alternatives are more than appreciated !
Please do not suggest Flash, as I do not own a valid Flash building license, I prefer to have this created within Visual Studio 2010.
Edit:
I want it to be as lightweight for the clients as possible, I don't care much for the server, and also low bandwidth consuming. I don't know whether a broadcasting principal is the only option to have all the events taken place at the same time?
You may want to take a look at the Polling Duplex protocol of WCF. This is the subscription and publish concept. Support in SL has been about since version 2 so there's plenty of articles out there. An article I referenced for a message broadcast system we put in place at work can be found here...
http://tomasz.janczuk.org/2009/07/pubsub-sample-using-http-polling-duplex.html
which also mentions an interesting project on codeplex (I've not used)...
http://laharsub.codeplex.com/
A simple and working (but rather inefficient) solution would be for all clients to ask a WCF/Ria service on the server for status updates in regular intervals, perhaps once every X seconds or so, letting the server keep track of changes relevant to the calling clients.

How to develop a rapid database & web application using Sybase and Power Builder?

I am new in Sybase and Power Builder.
What are the best references and web resources to learn them in a useful and fast way ?
For now, I use http://www.sybase.com as my base reference.
Does anyone know good and practical tutorials for Power Builder V.12 .Net ?
From Where I can download a complete version of it and use it for building my application ?
I know the data window is the magical part in Power Builder and I need to know how to create and use a professional data window and how to make interaction and pass paramters between them and also how to dispaly different views like Master-Detail relationship and Tree-Sturcture or List-Structure and so on.
I would like to know the information I need to build a rapid web and database application plus customzing and editing the existing desktop application.
There is a 45 trial version of Powerbuilder which you can download from here:
http://response.sybase.com/forms/PB12Eval
Sybase's books that come with Powerbuilder are fairly comprehensive and quite a good way to get started.
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.infocenter.pb.12.1/doc/html/title.html
I can't help with Powerbuilder but Rob Verschoor's Sypron.nl is the place to pick up Sybase information - there's loads in there from common "gotachas" to quizzes. His quick reference is terrific and well worth investing in.
Well, it all depends on how much experience you already have (not counting Sybase & PB).
Then there is the issue that app development and Db design are completely different disciplines: people who are good at one are rarely good at the other. Assuming you are the app developer, hire a good modeller/DBA. Product manuals are for reference only; you cannot learn how to code; put an app together; what code segments should be deployed where; best practice; etc from them.
To take even reasonable advantage of the DataWindow, you need a good Database (normalised, genuinely relational, security, etc), AND reasonable experience handling the client/server model (send SQL batch to server; receive & process result set).
You need a good PFC Library. The lib that comes with PB is fat as, and very slow. The first thing we do is strip that down, and create our own, to reduce .pbl size and increase speed.
Last but not least, a good handle on stored proc and Transaction rules. That requirement is true for any app, not just Sybase/Pb.
It sort of depends on what you want to do. PB12 comes with 2 IDEs -- PB12.NET is for creating WPF applications in .NET. PB12 Classic is for creating traditional PB applications as well as WinForm and WebForm .NET type applications.
There are some videos available on PB (some free, some paid)
Yakov Werde has a video titled "Essential PowerBuilder Series" that's about $700. You can see a free preview of it here.
Sybase has some free videos and tutorials here.
Also, there are some older PowerBuilder books like "PowerBuilder 9 Advanced Client/Server Development" that may help you. They're a little dated and don't cover any of the .NET stuff, but a lot of the basics are still the same.
The information you are looking for has always been somewhat of a challenge to find. Without all the corporate training I'm not sure how I would have learned as quickly.
If you are like me then learning by example is probably the best way. I'd go to codeplex and get yourself a working (and well designed) application to learn by example.
Also, believe it or not, I have learned a thing or two by reading the online documentation. Considering you are working with a new version of PB you've got your work cut out for you there isn't much out there. You may contact me if you have specific questions, if I have time then I would be happy to help a fellow developer.

How to build a real-time streaming data silverlight application

I'm curious to get some feedback and ideas on how one could go about building a realtime data streaming application. We can keep the source data generic for this exercise ... throughput info, stock trade pricing, etc. Just something that is constantly changing, and the information is stored in a database.
I am interested in building a silverlight application that the user can pull up and see real-time (or at least, seemingly realtime if polling is the only option) information in a chart or grid as it changes.
As you may imagine, the technology menu for this project is silverlight, asp.net, wcf, and sql server.
What is the right pattern (duplex wcf, polling) for this kind of application?
One example (and please remember, don't limit yourselves to thinking about the financial markets domain) is this "Strategydesk" product from TD ameritrade. You can see how it is constantly updating in real time:
http://www.tdameritrade.com/demo/strategydesk/1497_ameritrade_strategydesk.html
Silverlight has TwoWay DataBinding available to refresh UI seamlessly using ObservableCollections.
On the backend i'll prefer legacy methods "polling" using WCF. Duplex WCP isn;t the right option i think because only one machine can be requester either client or server.
Watch this screen cast:
http://blog.lab49.com/archives/2650
Jason Dolinger has presented a sample SL app for real time Stock updates.. its just a proof of concept.. hope it will help you.
Regards.
You might want to look into using sockets in Silverlight. That will probably be the fastest/most responsive way to send/receive real-time data.

Hoto measure the performance/resource status of a Silverlight application internally at runtime?

I want to measure the resource consumption of my silverlight application at runtime. I do NOT want to use an external profiler, since I want to evaluate the overall application performance (esp. regarding CPU consumption), to show/hide functionality depending on the current performance status of the application.
Is there a way to measure that?
Thx,
Juve
The Silverlight sandboxing model should not allow you to access things out of the box. I don't Silverlight enough to tell if CPU-utilization is an exception to that rule, but if you can not find anything on Google that is probably the case.
You best bet is to time the execution of some of your important methods, or calculate framerate or similar and use that as an indirect measurement of available performance.
This is probably easier to define relevant measures that way anyway. Like if framerate < 20 => remove stuff, if framerate > 30 => add stuff.
There is no Stopwatch in Silverlight, but you can find implementations on Google.

Resources