<div dir="ltr">@Stefan and anybody else interested re JSON...<div><br></div><div>You might like to investigate my JSON implementation, available free (as in beer) from my github repo. The RTL Smoketest project includes tests for the Deltics.JSON unit (smoketest framework is in the same repo) and also acts as an example of basic usage (though this should be fairly straightforward).</div><div><br></div><div>Supports Delphi 7 and later.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 23 March 2015 at 15:45, Stefan Mueller <span dir="ltr"><<a href="mailto:muellers@orcl-toolbox.com" target="_blank">muellers@orcl-toolbox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Some thoughts:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman""> </span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The real processing of the data be that in C# or Delphi (encoding to json/xml, etc) will probably be in <1ms range. The slight speed advantage of native compiled Delphi code over C# is irrelevant compared to the overhead of database, network and webserver request handling.<br><br><u></u><u></u></span></p><p><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman""> </span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The latest versions of IIS (anything version 8+) are quite speedy in request processing (catching up a bit with NGINX, etc). My webserver runs on an Xeon E3-1240 - which isn’t exactly very powerful hardware. last time I made some benchmarks I got 39k req/s for static content (small 174bytes file) and 9.3k req/s for a simple JSON Rest service (a simple service that returned some cities/states for a given country from cached data, 817bytes). That’s on default settings before performance tuning anything (which wasn’t necessary in my case). I’ve seen benchmarks running a simple service in WCF on a core i5 processor handling 50k+ req/s … I am sure if you get some proper hardware (xeon e7 ?) you can easily get into to 100k+ region.<br><br><u></u><u></u></span></p><p><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman""> </span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Delphi support for XML (through</span> <span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">OmniXML, don’t use the native Delphi MSXML) is ok … but still haven’t really found a good JSON library for Delphi. The built in functions are a pain to work with (especially if you need to read JSON). I wish there is something like FastJSON (a C# library) in Delphi for serializing/deserializing. <br><br><u></u><u></u></span></p><p><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman""> </span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">In my experience, anything web-related is just so much easier to do in DotNet. Delphi is great for desktop applications … and DotNet is fantastic for web stuff (great platform tied in with IIS, ASP.Net MVC, WCF, etc and heaps of awesome third party libraries). <br><br><u></u><u></u></span></p><p><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman""> </span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Benchmark your own service, it probably takes you less time to write a simple testcase in C# and benchmark it than it took me to respond to this email ;-/ … <br><br><u></u><u></u></span></p><p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal" style="margin-left:18.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><div><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">Kind regards,<br><br></span><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">Stefan Müller</span></b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">,<br>R&D Manager</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><br><br></span><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:white;background:red">ORCL</span></b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">Toolbox Ltd.</span></b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> <br></span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">Auckland, New Zealand</span><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:9.0pt;font-family:Webdings;color:#777777"><br>P</span><span style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#777777"> Please consider the environment before printing this email<br><br>This message is intended for the adresse named above and may contain privileged or confidential information.<br>If you are not the intended recipient of this message you must not use, copy, distribute or disclose it to anyone.<u></u><u></u></span></p></div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:delphi-bounces@listserver.123.net.nz" target="_blank">delphi-bounces@listserver.123.net.nz</a> [mailto:<a href="mailto:delphi-bounces@listserver.123.net.nz" target="_blank">delphi-bounces@listserver.123.net.nz</a>] <b>On Behalf Of </b>John Bird<br><b>Sent:</b> Monday, 23 March 2015 2:33 p.m.</span></p><div><div class="h5"><br><b>To:</b> NZ Borland Developers Group - Delphi List<br><b>Subject:</b> Re: [DUG] Delphi vs C# for web services performance<u></u><u></u></div></div><p></p></div></div><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black">Current version (Hospital Java app) used to have a requirement that the DB returns each result within 200ms (fires about 15 simultaneous queries to various systems including 2 or 3 to ours).<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black"> <u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black">Currently the calls are to stored procedures on a SQL Server cluster to get the data. The web service (Delphi or C#) would put a layer between the application and the DB, packaging the query results into XML or JSON and its pretty critical to get as close to the direct DB access speed as possible. At times being a hospital system the load is high and the response times are crucial.<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black"> <u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black"> <u></u><u></u></span></p></div><div><div><div><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black"> <u></u><u></u></span></p></div><div><div><p class="MsoNormal" style="background:whitesmoke"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black"> <a href="mailto:leigh.wanstead@gmail.com" title="leigh.wanstead@gmail.com" target="_blank">Leigh Wanstead</a> <u></u><u></u></span></p></div><div><p class="MsoNormal" style="background:whitesmoke"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">Sent:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black"> Monday, March 23, 2015 11:44 AM<u></u><u></u></span></p></div><div><p class="MsoNormal" style="background:whitesmoke"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">To:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black"> <a href="mailto:delphi@listserver.123.net.nz" title="delphi@listserver.123.net.nz" target="_blank">NZ Borland Developers Group - Delphi List</a> <u></u><u></u></span></p></div><div><p class="MsoNormal" style="background:whitesmoke"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">Subject:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black"> Re: [DUG] Delphi vs C# for web services performance<u></u><u></u></span></p></div></div></div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black"> <u></u><u></u></span></p></div></div><div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black">Hi John, <u></u><u></u></span></p><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black"> <u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black">What is your requirement for performance?<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black"> <u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black">i.e. One million user to get median value 100ms response time?<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black"> <u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black">Regards<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black">Leigh<u></u><u></u></span></p></div></div><div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black"> <u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black">On 23 March 2015 at 10:27, John Bird <<a href="mailto:johnkbird@paradise.net.nz" target="_blank">johnkbird@paradise.net.nz</a>> wrote:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black">There is a web service we might are looking at implementing. We could use<br>either Delphi or C#. Performance is highly critical. Will be getting<br>getting REST request, getting data from a DB. and packaging it into XML or<br>JSON according to the request.<br><br>We have noticed that some C# web services have some latency but this might<br>be due to how they are setup on IIS rather than an inherent language issue.<br><br>We are wondering if there is any clear reason to do it in Delphi - anyone<br>have metrics or references etc on performance?<br><br>_______________________________________________<br>NZ Borland Developers Group - Delphi mailing list<br>Post: <a href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a><br>Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz" target="_blank">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black"> <u></u><u></u></span></p></div></div><div class="MsoNormal" align="center" style="text-align:center"><span style="font-family:"Calibri","sans-serif";color:black"><hr size="3" width="100%" align="center"></span></div><p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black">_______________________________________________<br>NZ Borland Developers Group - Delphi mailing list<br>Post: <a href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a><br>Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz" target="_blank">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<u></u><u></u></span></p></div></div></div></div></div></div></div><br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<br></blockquote></div><br></div>