Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iTasks-SDK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
74
Issues
74
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
74749311
Verified
Commit
74749311
authored
May 30, 2019
by
Camil Staps
🚀
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up jsDeserialize: don't copy string to JS first
parent
f66fe190
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
Libraries/iTasks/UI/WebPublic/js/abc-interpreter.js
Libraries/iTasks/UI/WebPublic/js/abc-interpreter.js
+15
-6
No files found.
Libraries/iTasks/UI/WebPublic/js/abc-interpreter.js
View file @
74749311
...
...
@@ -79,10 +79,17 @@ const ABC={
var
max_words_needed
=
string
.
length
/
8
*
4
;
// rough upper bound
ABC
.
require_hp
(
max_words_needed
);
var
array
=
new
Int8Array
(
string
.
length
);
for
(
var
i
in
string
)
array
[
i
]
=
string
.
charCodeAt
(
i
);
var
graph
=
new
Uint32Array
(
array
.
buffer
);
var
graph
;
if
(
string
.
constructor
.
name
==
'
Uint32Array
'
)
{
graph
=
string
;
}
else
if
(
typeof
string
==
'
string
'
)
{
var
array
=
new
Uint8Array
(
string
.
length
);
for
(
var
i
=
0
;
i
<
string
.
length
;
i
++
)
array
[
i
]
=
string
.
charCodeAt
(
i
);
graph
=
new
Uint32Array
(
array
.
buffer
);
}
else
{
throw
new
ABCError
(
'
illegal argument type for ABC.deserialize()
'
);
}
var
unused_semispace
=
ABC
.
util
.
instance
.
exports
.
get_unused_semispace
();
for
(
var
i
=
0
;
i
<
graph
.
length
;
i
++
)
ABC
.
memory_array
[
unused_semispace
/
4
+
i
]
=
graph
[
i
];
...
...
@@ -481,8 +488,10 @@ ABC.loading_promise=fetch('js/app.pbc').then(function(resp){
ABC
.
memory_array
[
asp
/
4
]
=
ABC
.
shared_clean_values
[
index
].
ref
;
break
;
case
6
:
/* iTasks.UI.JS.Interface: deserialize */
var
string
=
ABC
.
get_clean_string
(
ABC
.
memory_array
[
asp
/
4
]);
ABC
.
memory_array
[
asp
/
4
]
=
ABC
.
deserialize
(
string
);
var
hp_ptr
=
ABC
.
memory_array
[
asp
/
4
];
var
size
=
ABC
.
memory_array
[
hp_ptr
/
4
+
2
];
var
array
=
new
Uint32Array
(
ABC
.
memory
.
buffer
,
hp_ptr
+
16
,
size
/
4
);
ABC
.
memory_array
[
asp
/
4
]
=
ABC
.
deserialize
(
array
);
break
;
case
7
:
/* iTasks.UI.JS.Interface: initialize_client in wrapInitUIFunction */
var
array
=
ABC
.
memory_array
[
asp
/
4
]
+
24
;
...
...
Camil Staps
🚀
@cstaps
mentioned in commit
979683c1
·
May 30, 2019
mentioned in commit
979683c1
mentioned in commit 979683c105fd3ea23565be0142c30862d0837067
Toggle commit list
Camil Staps
🚀
@cstaps
mentioned in commit
3ccab5c7
·
Jun 14, 2019
mentioned in commit
3ccab5c7
mentioned in commit 3ccab5c7030591b1dc7e7be90781acddc2d52015
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment