projects
/
roobuilder
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3077f71
)
Fix #8127 - performance issues - cache pulldowns
author
Alan
<alan@roojs.com>
Fri, 5 Apr 2024 06:05:25 +0000
(14:05 +0800)
committer
Alan
<alan@roojs.com>
Fri, 5 Apr 2024 06:05:25 +0000
(14:05 +0800)
src/Builder4/WindowLeftProps.bjs
patch
|
blob
|
history
src/Builder4/WindowLeftProps.vala
patch
|
blob
|
history
src/JsRender/NodeProp.vala
patch
|
blob
|
history
src/Palete/Roo.vala
patch
|
blob
|
history
diff --git
a/src/Builder4/WindowLeftProps.bjs
b/src/Builder4/WindowLeftProps.bjs
index
5b2cd59
..
d552b73
100644
(file)
--- a/
src/Builder4/WindowLeftProps.bjs
+++ b/
src/Builder4/WindowLeftProps.bjs
@@
-846,9
+846,9
@@
"id" : "valcol",
"items" : [
{
"id" : "valcol",
"items" : [
{
+ "# bool is_setting" : false,
"$ xns" : "Gtk",
"* prop" : "factory",
"$ xns" : "Gtk",
"* prop" : "factory",
- "bool is_setting" : false,
"listeners" : {
"bind" : [
"(listitem) => {",
"listeners" : {
"bind" : [
"(listitem) => {",
@@
-856,9
+856,7
@@
"",
"",
"\tvar bx = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();",
"",
"",
"\tvar bx = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();",
- " ",
- "\t",
- "\t",
+ " ",
"\t",
"\tvar elbl = (Gtk.EditableLabel)bx.get_first_child();",
"\tvar lbl = (Gtk.Label) elbl.get_next_sibling();",
"\t",
"\tvar elbl = (Gtk.EditableLabel)bx.get_first_child();",
"\tvar lbl = (Gtk.Label) elbl.get_next_sibling();",
diff --git
a/src/Builder4/WindowLeftProps.vala
b/src/Builder4/WindowLeftProps.vala
index
1200d93
..
7c8e66d
100644
(file)
--- a/
src/Builder4/WindowLeftProps.vala
+++ b/
src/Builder4/WindowLeftProps.vala
@@
-2340,9
+2340,7
@@
public class Xcls_LeftProps : Object
var bx = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();
var bx = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();
-
-
-
+
var elbl = (Gtk.EditableLabel)bx.get_first_child();
var lbl = (Gtk.Label) elbl.get_next_sibling();
var elbl = (Gtk.EditableLabel)bx.get_first_child();
var lbl = (Gtk.Label) elbl.get_next_sibling();
diff --git
a/src/JsRender/NodeProp.vala
b/src/JsRender/NodeProp.vala
index
76bd895
..
9bc879b
100644
(file)
--- a/
src/JsRender/NodeProp.vala
+++ b/
src/JsRender/NodeProp.vala
@@
-468,10
+468,10
@@
public class JsRender.NodeProp : Object {
owned get {
if (this._val.index_of("\n") < 0) {
owned get {
if (this._val.index_of("\n") < 0) {
- return
this._val
;
+ return
GLib.Markup.escape_text(this._val)
;
}
var vals = this._val.split("\n");
}
var vals = this._val.split("\n");
- return
vals[0] + (vals.length > 1 ? " ..." : ""
);
+ return
GLib.Markup.escape_text(vals[0] + (vals.length > 1 ? " ..." : "")
);
}
}
}
}
diff --git
a/src/Palete/Roo.vala
b/src/Palete/Roo.vala
index
d05c7a1
..
741123d
100644
(file)
--- a/
src/Palete/Roo.vala
+++ b/
src/Palete/Roo.vala
@@
-349,27
+349,34
@@
namespace Palete {
}
}
-
-
+
+ Gee.HashMap<string,string> typeOptionsCache { get ;set ; default = new Gee.HashMap<string,string>(); }
/*
* Pulldown options for type
*/
public override bool typeOptions(string fqn, string key, string type, out string[] opts)
{
opts = {};
/*
* Pulldown options for type
*/
public override bool typeOptions(string fqn, string key, string type, out string[] opts)
{
opts = {};
-
print
("get typeOptions %s (%s)%s", fqn, type, key);
+
GLib.debug
("get typeOptions %s (%s)%s", fqn, type, key);
if (type.up() == "BOOL" || type.up() == "BOOLEAN") {
opts = { "true", "false" };
return true;
if (type.up() == "BOOL" || type.up() == "BOOLEAN") {
opts = { "true", "false" };
return true;
- }
+ }
+ var cacheKey = fqn + ":"+ key;
+ if (this.typeOptionsCache.has_key(cacheKey)) {
+ opts = this.typeOptionsCache.get(cacheKey).split("\n");
+ return opts.length < 1 ? false : true;
+ }
var props = this.getPropertiesFor(fqn, JsRender.NodePropType.PROP);
if (!props.has_key(key)) {
var props = this.getPropertiesFor(fqn, JsRender.NodePropType.PROP);
if (!props.has_key(key)) {
+ this.typeOptionsCache.set(cacheKey, "");
print("prop %s does not have key %s\n", fqn, key);
return false;
}
var pr = props.get(key);
if (pr.optvalues.size < 1) {
print("prop %s does not have key %s\n", fqn, key);
return false;
}
var pr = props.get(key);
if (pr.optvalues.size < 1) {
+ this.typeOptionsCache.set(cacheKey, "");
print("prop %s no optvalues for %s\n", fqn, key);
return false;
}
print("prop %s no optvalues for %s\n", fqn, key);
return false;
}
@@
-379,6
+386,7
@@
namespace Palete {
}
opts = ret;
print("prop %s returning optvalues for %s\n", fqn, key);
}
opts = ret;
print("prop %s returning optvalues for %s\n", fqn, key);
+ this.typeOptionsCache.set(cacheKey, string.joinv("\n", ret));
return true;
}
return true;
}