Closed pruiz closed 8 years ago
Hi,
I've just commited a fix in order to make this build on travis. However we may want to build using both travis & appveyor, as to have builds (or better said have tests pass) with both platforms Win+DotNet & Linux+Mono.
Regards
Ok! there it is, building and tests passing on travis (ubuntu+mono-4.2.2).. :)
PS: I had to increase the time due for performance tests, as from what I've seen, mono is (interally) deserializing the app.config's XML content on each invocation, which makes it much slower than DotNet. I have yet to invest bit more time in order to check wether we can force it to cache /re-use things internally.. But I'll let this for a forthcoming pull-req.
This looks awesome :+1:
I'll do my best to merge it over the weekend.
PS. As for the performance issue I think your guess seems a bit illogical. We're comparing relative difference in time between regular config sections vs dynamic - both of them access the configuration xml through internal mono implementation. I don't remember what optimization changes I had to make to make it perform well on .net but I'm pretty sure the difference in speed between regular and dynamic sections was worse initially.
I've noticed that you've replaced the reflection emit part that generated setters for private fields with regular Field.SetValue
. While I doubt it's the reason for most part of the difference in performance it would be the first thing I would check.
I'll try to explain the performance issue a little better: I think in normal conditions mono does internally re-use ConfigurationProperties / PropertyInformation classes. But somehow (still yet to be investigated, heh) the way I am injecting dynamic elements makes this re-use simply to not work, provoking a re-read of the XML file on each invocation.
I've tried profiling it a bit, but I have not yet came to any 'fiable' conclusion.. :?
As for the emit issue, as mono does work on a few platforms (some of them with some restrictions as to what the JIT engine is allowed to do/emit, like when using LLVM), I was using SetValue on mono.. But, this works on other platforms too and did not cause any noticeable performance degradation (I've tested it on dotnet), I thought it would be easier to just use the same code on both platforms.
I see, having a simpler code is obivously a win. The performance improvements can always be added after this is merged ☺
@pruiz thanks again for the outstanding work.
Hi,
May you please publish a newer nuget package including this changes?
Regards Pablo
I'll do it over the weekend. Tried to tackle the performance issue but the tooling on mono/osx is not so nice as on .net/windows so I guess it will have to wait.
Hi,
This pull-req adds support for mono runtime (3.10+). With all tests passing ok, both on mono & dotnet.
Regards