{"action":"created","issue":{"url":"https://api.github.com/repos/ncsoft/Unreal.js/issues/61","repository_url":"https://api.github.com/repos/ncsoft/Unreal.js","labels_url":"https://api.github.com/repos/ncsoft/Unreal.js/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/ncsoft/Unreal.js/issues/61/comments","events_url":"https://api.github.com/repos/ncsoft/Unreal.js/issues/61/events","html_url":"https://github.com/ncsoft/Unreal.js/issues/61","id":147943021,"number":61,"title":"How to use Huge Typed Array?","user":{"login":"mflux","id":1041360,"avatar_url":"https://avatars.githubusercontent.com/u/1041360?v=3","gravatar_id":"","url":"https://api.github.com/users/mflux","html_url":"https://github.com/mflux","followers_url":"https://api.github.com/users/mflux/followers","following_url":"https://api.github.com/users/mflux/following{/other_user}","gists_url":"https://api.github.com/users/mflux/gists{/gist_id}","starred_url":"https://api.github.com/users/mflux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mflux/subscriptions","organizations_url":"https://api.github.com/users/mflux/orgs","repos_url":"https://api.github.com/users/mflux/repos","events_url":"https://api.github.com/users/mflux/events{/privacy}","received_events_url":"https://api.github.com/users/mflux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-04-13T04:27:22Z","updated_at":"2016-04-14T03:39:13Z","closed_at":null,"body":"Hi Nako, I seem to be running into speed issues passing large arrays from JS into Unreal. The size range is between 3000 to 16000 floats, for passing geometry data from JS to Unreal.\r\n\r\nI'm 99% sure the speed loss is due to JS transfering data and needs to use: https://github.com/ncsoft/Unreal.js/wiki/Huge-typed-array\r\n\r\nHowever, I'm uncertain how to actually pass to for example, ProceduralMesh component's UpdateMeshSection function.\r\n\r\nI'm comfortable enough with C++ do dive in however this is still confusing to me:\r\n\r\n    let ab = new ArrayBuffer(32*1024); // 32K bytes buffer\r\n    let u8 = new Uint8Array(ab); // typed array\r\n    memory.bind(ab);\r\n    GWorld.MySuperMemoryFunction();\r\n    memory.unbind(ab);\r\n\r\nWhat is MySuperMemoryFunction()? Is this compiled from somewhere? How do you go about creating that function? Is 'ab' variable supposed to be passed in?\r\n\r\n    void UMyBlueprintFunctionLibrary::MySuperMemoryFunction(UWorld* World)\r\n    {\r\n        auto size = FArrayBufferAccessor::GetSize();\r\n        auto buffer = FArrayBufferAccessor::GetData();\r\n    }\r\n\r\nIs there just a single FArrayBufferAccessor that's bound as a global variable? What's the best way to go from here to ProceduralMesh's UpdateMeshSection?\r\n"},"comment":{"url":"https://api.github.com/repos/ncsoft/Unreal.js/issues/comments/209742168","html_url":"https://github.com/ncsoft/Unreal.js/issues/61#issuecomment-209742168","issue_url":"https://api.github.com/repos/ncsoft/Unreal.js/issues/61","id":209742168,"user":{"login":"nakosung","id":2463571,"avatar_url":"https://avatars.githubusercontent.com/u/2463571?v=3","gravatar_id":"","url":"https://api.github.com/users/nakosung","html_url":"https://github.com/nakosung","followers_url":"https://api.github.com/users/nakosung/followers","following_url":"https://api.github.com/users/nakosung/following{/other_user}","gists_url":"https://api.github.com/users/nakosung/gists{/gist_id}","starred_url":"https://api.github.com/users/nakosung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nakosung/subscriptions","organizations_url":"https://api.github.com/users/nakosung/orgs","repos_url":"https://api.github.com/users/nakosung/repos","events_url":"https://api.github.com/users/nakosung/events{/privacy}","received_events_url":"https://api.github.com/users/nakosung/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T03:39:13Z","updated_at":"2016-04-14T03:39:13Z","body":"Yes, unguarded operations are deprecated. :)\r\n\r\n```js\r\nmemory.exec(ab, function() {\r\n  // all operations which accesses array buffer should be guarded within this function.\r\n  GWorld.FastArrayCopy();\r\n})\r\n```"}}