Only one rule (or items file) or many separated ones?

Hi all,

general question: Is it better to put all rules (or items) into one single file or would it be better to split rules (and items) file in several small ones?

From the coding perspective it is better to organize them in different files, but what is best thinking about performance? So e.g. in which constellation (one big file or many small files) changes in one file can processed faster?

Thanks in advance
Thomas

On every edit of a rules or an item file, the file and it’s content is reloaded. Therefore i’m using a few different item and rule files to make sure the system keeps running without setting most of the item values to NUL and it keeps the system started rules from reloading.

So i would advice a system with a few separate item/rule files.

not quite! :wink:
on every change of any item file, the whole bunch of items get reloaded. That is, because of potential links between items in different files.
Rules are loaded easily, so there’s no reloading at all.
From the loading perspective I didn’t see some lagging, if using multiple files.

For me, I use multiple files for each type: Things - Items - Rules, simply because, I can keep better track of them. So I have a Thing file for each binding and for at least each binding one, sometimes more, if there are many items in it.

1 Like

Thomas, if you use a system started rule trigger, the rule will restart on reload. As for the items file, i thought that only the items in the changed item file are reset. I’ll check it out again.

regarding rules. I think, they’re just stored inside OH2 with their IDs and can be reloaded seperately, but I’m no expert here. :wink:
But re items, it is definitely all item files get reloaded if just one is changed/touched. As I said, because you can have items related to each other like groups.

2 Likes

Did you have the chance to verify?
I changed now to many separated item files and have the feeling that changes in a single file are processed faster now instead of a small change in a big item file… But it’s just a feeling :wink: