Good to hear you got it fixed :)
Tooling is one thing, but it pays to sometimes apply some old school
handcoding.
-Oorspronkelijk bericht-
Van: monodroid-boun...@lists.ximian.com
[mailto:monodroid-boun...@lists.ximian.com] Namens Jeremy A. Kolb - ARA/NED
Verzonden: maandag 7 januari 2013 14:51
Aan: Discussions related to Mono for Android
Onderwerp: Re: [mono-android] Copying data between Dalvik and Mono... major
slowdown.
I had a feeling that was why. Anyway I wrote my own implementation in C# using
Mono.Data.Sqlite with my own version of the ContentValues class. It now
executes in 1/4 of the time.
-Original Message-
From: monodroid-boun...@lists.ximian.com
[mailto:monodroid-boun...@lists.ximian.com] On Behalf Of Jonathan Pryor
Sent: Sunday, January 06, 2013 10:34 PM
To: Discussions related to Mono for Android
Subject: Re: [mono-android] Copying data between Dalvik and Mono... major
slowdown.
On Jan 3, 2013, at 4:32 PM, Jeremy A. Kolb - ARA/NED wrote:
> Furthermore, In:
>
> [Register("bulkInsert",
> "(Landroid/net/Uri;[Landroid/content/ContentValues;)I", "")]
> public int BulkInsert(Android.Net.Uri url, ContentValues[] values)
> {
> IntPtr num1 = JNIEnv.NewArray(values);
> ...
> if (values != null)
> {
> JNIEnv.CopyArray(num1, values);
> JNIEnv.DeleteLocalRef(num1);
> }
> return num2;
> }
>
> Why is the array copied back in after the function call? values shouldn't
> have changed.
_You_ know that. The generator does not; it can change on a method-by-method
basis, and the generator needs to generate code to support it.
> url certainly doesn't get the same treatment.
`url` isn't an array, and thus has "pass by value" semantics.
For example, consider this potential Java method:
public int bulkInsert(Uri url, ContentValues[] values) {
url = new Url (...);
values [0] = new ContentValues (...);
}
The caller of `bulkInsert()` will _not_ be able to see that bulkInsert()
modified `url`. That is _not_ true for `values[0]`; the caller _will_ be able
to see the change performed to `values[0]`, were it to be changed.
- Jon
___
Monodroid mailing list
Monodroid@lists.ximian.com
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
___
Monodroid mailing list
Monodroid@lists.ximian.com
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Op dit e-mailbericht is de disclaimer van Info Support van toepassing, zie
http://www.infosupport.com/disclaimer
___
Monodroid mailing list
Monodroid@lists.ximian.com
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid